问题描述
我正在尝试为
结论
Recaptcha可以轻松检测 WebDriver启动浏览上下文.
但是有一些避免检测的通用方法,您可以在
Outro
您可以在以下位置找到相关的详细讨论:
I'm trying to make a bot for https://www.phonehouse.nl/verlengchecker . But when I use Chrome it gets detected. When I use Firefox it only opens the page and doesn't do anything. I tried it on Arch linux and Windows result is the same.
from selenium import webdriver
from time import sleep
capabilities = {
'browserName': 'chrome',
'chromeOptions': {
'useAutomationExtension': False,
'forceDevToolsScreenshot': True,
'args': ['--start-maximized', '--disable-infobars']
}
}
driver = webdriver.Chrome(capabilities=capabilities)
def control(provider, number, day, month, year, post, email, street):
driver.get("https://www.phonehouse.nl/verlengchecker")
sleep(1)
driver.find_element_by_xpath("//span[@id='businessSelectBoxIt']").send_keys(provider) #provider
driver.find_element_by_xpath("//input[@name='msisdn']").send_keys(number) #number
Your analysis was in the right direction. Selenium driven ChromeDriver initiated google-chrome Browsing Context can easily get detected by the recaptcha.
Deep Dive
If you access the DOM Tree you will find the existance of the recaptcha.
Conclusion
Recaptcha can easily detect WebDriver initiated Browsing Context.
However there are some generic ways to avoid detection and you can find a detailed discussion in How to bypass Google captcha with Selenium and Python?
Outro
You can find a relevant detailed discussion in:
这篇关于硒铬被检测到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!