Skip to content

Instantly share code, notes, and snippets.

@mchlmicy
Last active November 30, 2017 00:18
Show Gist options
  • Select an option

  • Save mchlmicy/a17bc7fe345736c7f61c54df12210fa0 to your computer and use it in GitHub Desktop.

Select an option

Save mchlmicy/a17bc7fe345736c7f61c54df12210fa0 to your computer and use it in GitHub Desktop.
Reusable Selenium browser
# data types
import time
# webdriver
from selenium import webdriver
def create():
client = webdriver.Firefox()
specs = {'url': client.command_executor._url, 'session_id': client.session_id}
print(specs)
return specs
client_specs = create()
def connect():
time.sleep(3)
client = webdriver.Remote(command_executor=client_specs['url'], desired_capabilities={})
client.session_id = client_specs['session_id']
client.get('https://google.com')
connect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment