Skip to content

Instantly share code, notes, and snippets.

@rinchik
Last active May 12, 2018 13:31
Show Gist options
  • Save rinchik/18c2990c1fd3655d814f49d34859d013 to your computer and use it in GitHub Desktop.
Save rinchik/18c2990c1fd3655d814f49d34859d013 to your computer and use it in GitHub Desktop.
Capital One Investing login from the home page method
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