browser = webdriver.Firefox()
browser.get('http://www.google.com')
browser.save_screenshot('screenie.png')
browser.quit()
with webdriver.Firefox() as browser:
browser.get('http://www.google.com')
browser.save_screenshot('screenie.png')
In [1]: from selenium import webdriver
In [2]: bro = webdriver.Firefox()
In [3]: bro.__enter__
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-d8c2812442f0> in <module>()
----> 1 bro.__enter__
AttributeError: 'WebDriver' object has no attribute '__enter__'