下载浏览器
下载链接:https://ftp.mozilla.org/pub/firefox/releases/
79.0为版本号,可以替换 https://download-installer.cdn.mozilla.net/pub/firefox/releases/79.0/win64/zh-CN/Firefox%20Setup%2079.0.exe
设置不更新:https://jingyan.baidu.com/article/da1091fb712f5f027949d671.html
下载驱动
https://liushilive.github.io/github_selenium_drivers/md/Firefox.html
隐藏window.navigator.webdriver属性
参考: https://blog.csdn.net/mighty13/article/details/113575905
https://blog.csdn.net/weixin_43268350/article/details/111030616?spm=1001.2101.3001.6650.3&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-3.pc_relevant_paycolumn_v3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-3.pc_relevant_paycolumn_v3&utm_relevant_index=6
profile = webdriver.FirefoxProfile()
profile.set_preference("dom.webdriver.enabled", False)
driver = webdriver.Firefox(options=options,firefox_profile=profile)
检查
js="return window.navigator.webdriver"
result=driver.execute_script(js)
|