I’m trying to screen scrape my own credit card information from the Discover website using selenium and chromedriver. In response it returns the error:
Your account cannot currently be accessed.
Outdated browsers can expose your computer to security risks. To get
the best experience on Discover.com, you may need to update your
browser to the latest version and try again.
Interestingly, if I write a script to open a headed browser and type in some random account and password, it works normally. But if the script first touches the web page and then I type, I get the above error message. The script that works is:
import time
from selenium import webdriver
driver = webdriver.Chrome()
driver.execute_script('window.location.href = "https://portal.discover.com/customersvcs/universalLogin/ac_main";')
It fails if I append these lines to the script and type after the sleep finishes:
time.sleep(5)
driver.find_element_by_id('userid-content').click()
I’ve tried other ways to enter data into the page, such as send_keys and executing Javascript to modify the page and they all fail the same way.
How can the website detect the remote control? Is there a way to circumvent it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…