lye*_*ian 5 python selenium google-chrome selenium-chromedriver selenium-webdriver
我正在尝试在网站 www.mouser.co.uk 的 python 中使用 selenium chromedriver。但是,它从第一次拍摄就被检测为机器人。
有没有人对此有解释?此后我使用的代码:
options = Options()
options.add_argument("--start-maximized")
browser = webdriver.Chrome('chromedriver.exe',chrome_options=options)
wait = WebDriverWait(browser, 30)
browser.get('https://www.mouser.co.uk')
Run Code Online (Sandbox Code Playgroud)
我曾尝试https://www.mouser.co.uk/使用某些chrome.options访问该 url ,但确实被检测到并被重定向到Pardon Our Interruption页面。
代码块:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
options = Options()
options.add_argument("start-maximized")
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
driver.get("https://www.mouser.co.uk")
myElement = WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH, "//a[@id='1_lnkLeftFlag']")))
driver.execute_script("arguments[0].click();", myElement)
Run Code Online (Sandbox Code Playgroud)现在在检查“原谅我们的中断”页面时,您会发现该<body>标签包含:
dist-GlobalHeaderdist-PageWrap这清楚地表明该网站受到机器人管理服务提供商Distil Networks 的保护,ChromeDriver的导航被检测到并随后被阻止。
根据文章确实有一些关于 Distil.it...:
Distil 通过观察站点行为和识别爬虫特有的模式来保护站点免受自动内容爬取机器人的侵害。当 Distil 在一个站点上识别出恶意机器人时,它会创建一个列入黑名单的行为配置文件,并将其部署给所有客户。类似于机器人防火墙,Distil 检测模式并做出反应。
更远,
"One pattern with Selenium was automating the theft of Web content",Distil 首席执行官 Rami Essaid 上周在接受采访时表示。"Even though they can create new bots, we figured out a way to identify Selenium the a tool they're using, so we're blocking Selenium no matter how many times they iterate on that bot. We're doing that now with Python and a lot of different technologies. Once we see a pattern emerge from one type of bot, then we work to reverse engineer the technology they use and identify it as malicious".
您可以在以下位置找到一些详细的讨论:
| 归档时间: |
|
| 查看次数: |
4611 次 |
| 最近记录: |