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)

显示结果如下

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

相关推荐
wj3055853785 小时前
课程 9:模型测试记录与 Prompt 策略
linux·人工智能·python·comfyui
星寂樱易李6 小时前
iperf3 + Python-- 网络带宽、网速、网络稳定性
开发语言·网络·python
qingfeng154156 小时前
企业微信机器人开发:如何实现自动化与智能运营?
人工智能·python·机器人·自动化·企业微信
彦为君9 小时前
Agent 安全:从权限提示到沙箱隔离
python·ai·ai编程
PILIPALAPENG10 小时前
Python 语法速成指南:前端开发者视角(JS 类比版)
前端·人工智能·python
用户83562907805111 小时前
Python 操作 PowerPoint 页眉与页脚指南
后端·python
枫叶林FYL11 小时前
项目九:异步高性能爬虫与数据采集中枢 —— 基于 Crawl<sub>4</sub>AI 与 Playwright 的现代化数据采集平台 项目总览
爬虫·python·深度学习·wpf
猫猫的小茶馆12 小时前
【Python】函数与模块化编程
linux·开发语言·arm开发·驱动开发·python·stm32
Miss_min12 小时前
128K长序列数据生成
开发语言·python·深度学习