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)

显示结果如下

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

相关推荐
circuitsosk20 小时前
NL2SQL在工业级场景下的精度优化:Schema Linking + 动态Few-shot实战
人工智能·python·sql·大模型·nl2sql
kobe_OKOK_1 天前
DRF接口幂等操作
python·django
廿士1 天前
python脚本使用相关
python
青 春 记 忆1 天前
零基础入门python19:Flask账本第一步——应用工厂、蓝图和健康检查
python·flask·后端开发
朦胧之1 天前
Python 后端核心知识
python
denggun123451 天前
yield
前端·数据库·python
zx_741484811 天前
【Python 入门】面向对象基础:类、对象、成员变量与构造方法
开发语言·python
招财小梗1 天前
沈阳商贸公司AI企业服务优势几何?
大数据·人工智能·python
ZISHU_9871 天前
用 TLabel 给 SynTouch BioTac 数据做语义标注:从原始信号到结构化标注
开发语言·人工智能·python·数据·机器人触觉
m0_617493941 天前
SSLError [ASN1: NOT_ENOUGH_DATA] 问题排查与解决指南
python·ssl