Created
June 24, 2015 08:06
-
-
Save ShinNoNoir/edd61d152911c5efbcfb to your computer and use it in GitHub Desktop.
Python Selenium example for logging into Paypal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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