Skip to content

Instantly share code, notes, and snippets.

@ShinNoNoir
Created June 24, 2015 08:06
Show Gist options
  • Select an option

  • Save ShinNoNoir/edd61d152911c5efbcfb to your computer and use it in GitHub Desktop.

Select an option

Save ShinNoNoir/edd61d152911c5efbcfb to your computer and use it in GitHub Desktop.
Python Selenium example for logging into Paypal
# Simple example to log into Paypal (far from feature complete)
# Requires: Firefox installed on machine
import getpass
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
LOGIN_URL = 'https://www.paypal.com/signin/'
USER = raw_input('User: ')
PASS = getpass.getpass()
driver = webdriver.Firefox()
driver.get(LOGIN_URL)
elem = driver.find_element_by_id('email')
elem.send_keys(USER)
elem = driver.find_element_by_id('password')
elem.send_keys(PASS)
elem.send_keys(Keys.RETURN)
# TODO: Appropriately wait for login to complete, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment