<s> import base64 <EOL> from selenium . webdriver . remote . command import Command <EOL> from selenium . webdriver . remote . webdriver import WebDriver as RemoteWebDriver <EOL> from selenium . webdriver . common . desired_capabilities import DesiredCapabilities <EOL> from selenium . common . exceptions import WebDriverException <EOL> from . service import Service <EOL> class WebDriver ( RemoteWebDriver ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , executable_path = "<STR_LIT>" , <EOL> port = <NUM_LIT:0> , desired_capabilities = DesiredCapabilities . PHANTOMJS , <EOL> service_args = None , service_log_path = None ) : <EOL> """<STR_LIT>""" <EOL> self . service = Service ( executable_path , port = port , <EOL> service_args = service_args , log_path = service_log_path ) <EOL> self . service . start ( ) <EOL> try : <EOL> RemoteWebDriver . __init__ ( self , <EOL> command_executor = self . service . service_url , <EOL> desired_capabilities = desired_capabilities ) <EOL> except : <EOL> self . quit ( ) <EOL> raise <EOL> self . _is_remote = False <EOL> def quit ( self ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> RemoteWebDriver . quit ( self ) <EOL> except : <EOL> pass <EOL> finally : <EOL> self . service . stop ( ) </s>
