Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save storenth/f389c2218ff8f66f1f4c3ce58af99cf1 to your computer and use it in GitHub Desktop.
Save storenth/f389c2218ff8f66f1f4c3ce58af99cf1 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