Skip to content

Instantly share code, notes, and snippets.

Last active Aug 4, 2016
What would you like to do?
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
class Firefox(object):
def __init__(self, binary=None):
if binary is None:
self.driver = webdriver.Firefox()
binary = FirefoxBinary(binary)
self.driver = webdriver.Firefox(firefox_binary=binary)
def __enter__(self):
return self.driver
def __exit__(self, exception_type, exception_value, traceback):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment