我在住宅代理网络后面的Ubuntu服务器上通过 Selenium 运行 Chrome 驱动程序。然而,我的硒正在被检测到。有没有办法让 Chrome 驱动程序和 Selenium 100% 无法检测?
我已经尝试了很长时间,但我忘记了我所做的许多事情,包括:
我正在寻找 100% 无法检测到的真正 Selenium 版本。如果那曾经存在过。或者机器人跟踪器无法检测到的另一种自动化方式。
这是浏览器启动的一部分:
sx = random.randint(1000, 1500)
sn = random.randint(3000, 4500)
display = Display(visible=0, size=(sx,sn))
display.start()
randagent = random.randint(0,len(useragents_desktop)-1)
uag = useragents_desktop[randagent]
#this is to prevent ip leaking
preferences =
"webrtc.ip_handling_policy" : "disable_non_proxied_udp",
"webrtc.multiple_routes_enabled": False,
"webrtc.nonproxied_udp_enabled" : False
chrome_options.add_experimental_option("prefs", preferences)
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-impl-side-painting")
chrome_options.add_argument("--disable-setuid-sandbox")
chrome_options.add_argument("--disable-seccomp-filter-sandbox")
chrome_options.add_argument("--disable-breakpad")
chrome_options.add_argument("--disable-client-side-phishing-detection")
chrome_options.add_argument("--disable-cast")
chrome_options.add_argument("--disable-cast-streaming-hw-encoding")
chrome_options.add_argument("--disable-cloud-import")
chrome_options.add_argument("--disable-popup-blocking")
chrome_options.add_argument("--ignore-certificate-errors")
chrome_options.add_argument("--disable-session-crashed-bubble")
chrome_options.add_argument("--disable-ipv6")
chrome_options.add_argument("--allow-http-screen-capture") …Run Code Online (Sandbox Code Playgroud) selenium google-chrome webdriver selenium-chromedriver selenium-webdriver
我正在尝试使用selenium和chrome在网站中自动执行一项非常基本的任务,但不知何故,网站检测到chrome由硒驱动并阻止每个请求.我怀疑该网站依赖于一个暴露的DOM变量,如/sf/answers/2933311741/来检测selenium驱动的浏览器.
我的问题是,有没有办法让navigator.webdriver标志为假?我愿意在修改之后尝试重新编译硒源,但我似乎无法在存储库中的任何地方找到NavigatorAutomationInformation源https://github.com/SeleniumHQ/selenium
任何帮助深表感谢
PS:我还从https://w3c.github.io/webdriver/#interface尝试了以下内容
Object.defineProperty(navigator, 'webdriver', {
get: () => false,
});
Run Code Online (Sandbox Code Playgroud)
但它只在初始页面加载后更新属性.我认为该网站在我的脚本执行之前检测到该变量.
java selenium webdriver selenium-webdriver webdriver-w3c-spec