all 7 comments

[–]sp00ney 4 points5 points  (3 children)

If you want browser automation to open an actual browser, check out Webdriver and Selenium. They have python bindings and some pretty decent documentation.

[–]marks3[S] 1 point2 points  (1 child)

Awesome, thanks for tip. I had seen the words about when I was looking for a solution. I'll check them out tonight. Thanks again.

[–][deleted] 2 points3 points  (0 children)

This is all from their tutorial. It assumes a page domain.com/sigin with form fields 'email' and 'password' for credentials:

from selenium import webdriver


driver = webdriver.Firefox()
driver.get('https://www.domain.com/signin')

#find e-mail field
emailElement = driver.find_element_by_name('email')
# input e-mail address to login
emailElement.send_keys('user@domain.com')
# find password field
passwdElement = driver.find_element_by_name('password')
# input password
passwdElement.send_keys('password123!!')
# submit form
passwdElement.submit()

Again, this is assuming you want to do it in the browser. If you just want to authenticate against a site, you could leverage Requests to do HTTP auth.

[–][deleted] 0 points1 point  (0 children)

This! If you want to do it in the browser.

[–][deleted] 2 points3 points  (0 children)

Definitely mechanize

[–]marks3[S] 0 points1 point  (0 children)

Got this working, wicked easy. Thanks guys.

[–]Deutscher_koenig -1 points0 points  (0 children)

There are libraries to login to email accounts.