When I try to log into the Chase website using Selenium (Python), I'm hit with the following error message:
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.
Update:
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()
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…