bastostam 1
bastostam 1

Reputation: 75

How to close a window in Selemiun with Python

I'm trying to close a window in Selenium with Python,

I have already tried the next code:

driver = webdriver.Firefox()

driver.get('link')
driver.quit()

The problem is the next, that I can still see an opened window.

Upvotes: 1

Views: 53

Answers (1)

WyattBlue
WyattBlue

Reputation: 631

Best practice is to close the webdriver before quitting

driver = webdriver.Firefox()

driver.get('https://stackoverflow.com')

driver.close()
driver.quit()

Upvotes: 2

Related Questions