selenium绕过网站检测的方法

使用selenium打开如下网站,进行检测,代码如下:

python 复制代码
from selenium import webdriver
import time

driver = webdriver.Chrome()
driver.get('https://bot.sannysoft.com/')
time.sleep(60)

发现webdriver被检测到了

在这里可使用一个selenium提供的插件undetected_chromedriver,使用这个可以通过检测。

python 复制代码
import undetected_chromedriver as undetected_diver
import time

driver = undetected_diver.Chrome(driver_executable_path=r'C:\Program Files\Google\Chrome\Application\undetected_chromedriver.exe',
                       browser_executable_path=r'C:\Program Files\Google\Chrome\Application\chrome.exe',
                       use_subprocess=True)
driver.get('https://bot.sannysoft.com/')
time.sleep(60)

显示结果如下

使用这个,对于一些有网站有瑞数加密的都可以通过,非常强大。

相关推荐
_Jimmy_3 小时前
Agent 溯源精度提升方案
人工智能·python·langchain
SamChan904 小时前
在Web应用中集成PDF多语言翻译功能:PDFTranslator API实战指南
前端·python·ai·pdf·yapi·机器翻译
天天进步20154 小时前
Python全栈项目--智能办公自动化系统
开发语言·python
颜酱5 小时前
09 | 重构项目结构
人工智能·python·langchain
kisloy6 小时前
【爬虫入门第8讲】Python爬虫反爬入门
开发语言·爬虫·python
Sisphusssss6 小时前
香橙派5plus GPIO
linux·python·ubuntu
颜酱7 小时前
08 | 把维度值同步到 Elasticsearch(生成阶段)
人工智能·python·langchain
久久学姐7 小时前
基础转码学 AI:Java+Python 双语言入门,3 个月可落地实战项目
java·python·ai·转码·实战项目
ZHOU_WUYI7 小时前
4. light wam 模型loss计算过程
开发语言·人工智能·python
nwsuaf_huasir7 小时前
【无标题】
python