Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium.webdriver.phantomjs.webdriver import RemoteWebDriver
- from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
- class WebDriver(RemoteWebDriver):
- def __init__(self, executable_path="phantomjs",
- port=0, desired_capabilities=DesiredCapabilities.PHANTOMJS,
- service_args=None, service_log_path=None):
- super(WebDriver, self).__init__(
- command_executor='http://127.0.0.1:8910/wd/hub',
- desired_capabilities=DesiredCapabilities.PHANTOMJS,
- )
- def quit(self):
- self.command_executor._request(
- 'GET', '{}/shutdown'.format(self.command_executor._url), 'shutdown')
- driver = WebDriver()
- driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement