username = 'myusername'
password = 'mypassword'
browser.get('http://www.mywebsite.com/')
username_input = browser.find_element_by_id('username')
password_input = browser.find_element_by_id('password')
login_button = browser.find_element_by_id('login')
username_input.send_keys(username)
password_input.send_keys(password)
login_button.click()
Использовать файл cookie urllib2 в Selenium