Sunday, 20 January 2019

Unable to use Selenium to automate Chase site login

When I try to log into the Chase website using Selenium (Python), I'm hit with the following error message:

Chase Login Failure Image

However, using "human" login works fine. It seems that when Selenium finds an element it triggers the issue.

Am I missing something? I've tried to find the answer on stackoverflow but to no avail.

EDIT: The expected result is that the script would successfully allow me to login programatically.

Here's the code sample below:

import time
import os

from selenium import webdriver

CHASE_USER_ID = os.getenv('CHASE_USER_ID', None)
CHASE_PASSWORD = os.getenv('CHASE_PASSWORD', None)

assert CHASE_USER_ID is not None, 'Chase user id not set'
assert CHASE_PASSWORD is not None, ' Chase password not set'


def main():
    chrome_options = webdriver.ChromeOptions()
    driver = webdriver.Chrome(r'./chromedriver', chrome_options=chrome_options)

    try:
        driver.get('https://secure07c.chase.com/web/auth/#/logon/logon/chaseOnline?')

        time.sleep(2)

        user_element = driver.find_element_by_id('userId-input-field')  # Finding an element here seems to make the login process fail 
        user_element.send_keys(CHASE_USER_ID)

        password_element = driver.find_element_by_id('password-input-field')
        password_element.send_keys(CHASE_PASSWORD)

        time.sleep(2)

        password_element.submit()

        time.sleep(10)
    finally:
        driver.quit()


if __name__ == '__main__':
    main()



from Unable to use Selenium to automate Chase site login

1 comment:

  1. I have been your silent reader for long.. Now I think you have to know how much your articles have inspired me to do better. This is very insightful and informative. Thank you for sharing. I would love to see more updates from you.

    Melbourne SEO Services

    ReplyDelete