Auto WP login with selenium

From the Automate the Boring Stuff with Python book:

from selenium import webdriver
browser = webdriver.Chrome()
usernameBox = browser.find_element_by_id('user_login')
passwordBox = browser.find_element_by_id('user_pass')
passwordBox.send_keys('PASSWORD HERE')

Needed to make sure to have “chromedriver” installed from brew on OS X. Tried getting it working with Firefox driver (geckodriver) but hit a bunch of issues with not being able to find binaries when trying with Firefox Nightly edition.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.