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()
I took your code and simplified the structure and ran the test with minimal lines of code as follows:
Similarly, as per your observation I have hit the same roadblock with the error as:
It seems the
click()
on the element with text as Sign in does happens. Though the username / password lookup is initiated but the process is interupted. While inspecting the DOM Tree of the webpage you will find that some of the<script>
tag refers to JavaScripts having keyword dist. As an example:<script src="https://static.chasecdn.com/web/library/blue-boot/dist/2.20.3/blue-boot/js/main-ver.js"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="blue-vendor/main" src="https://static.chasecdn.com/web/library/blue-vendor/dist/2.11.1/blue-vendor/js/main.js"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="blue/main" src="https://static.chasecdn.com/web/library/blue-core/dist/2.16.3/blue/js/main.js"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="blue-app/main" src="https://static.chasecdn.com/web/library/blue-app/dist/2.15.1/blue-app/js/main.js"></script>
Which is a clear indication that the website is protected by Bot Management service provider Distil Networks and the navigation by ChromeDriver gets detected and subsequently blocked.
Distil
As per the article There Really Is Something About Distil.it...:
Further,
Reference
You can find a couple of detailed discussion in: