Forked from rinchik/CapitalOneInvestingSeleniumLoging.py
Created
May 12, 2018 13:31
-
-
Save storenth/f389c2218ff8f66f1f4c3ce58af99cf1 to your computer and use it in GitHub Desktop.
Capital One Investing login from the home page method
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
def login(self): | |
print 'Login ...' | |
self.driver.get(self.capital_url) # capital_url - Capital One Investing home page url | |
username_field = self.driver.find_element_by_css_selector('input#widget_signInUsername') | |
username_field.clear() # clear() is required for their form or send_key() below will fail | |
username_field.send_keys(self.username) | |
password_field = self.driver.find_element_by_css_selector('input#widget_signInPassword') | |
password_field.clear() | |
password_field.send_keys(self.password) | |
submit = self.driver.find_element_by_css_selector('#widget > div.SignInButtonWrapper > div.SignIn > a') | |
submit.click() | |
print 'Done.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment