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)

显示结果如下

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

相关推荐
mahuifa1 小时前
(7)python开发经验
python·qt·pyside6·开发经验
学地理的小胖砸3 小时前
【Python 操作 MySQL 数据库】
数据库·python·mysql
安迪小宝3 小时前
6 任务路由与负载均衡
运维·python·celery
Blossom.1183 小时前
使用Python实现简单的人工智能聊天机器人
开发语言·人工智能·python·低代码·数据挖掘·机器人·云计算
lisw053 小时前
Python高级进阶:Vim与Vi使用指南
python·vim·excel
ayiya_Oese3 小时前
[模型部署] 3. 性能优化
人工智能·python·深度学习·神经网络·机器学习·性能优化
SoraLuna3 小时前
「Mac畅玩AIGC与多模态40」开发篇35 - 用 Python 开发服务对接 SearxNG 与本地知识库
python·macos·aigc
noravinsc4 小时前
redis是内存级缓存吗
后端·python·django
王学政24 小时前
LlamaIndex 第九篇 Indexing索引
人工智能·python
百锦再4 小时前
大数据技术的主要方向及其应用详解
大数据·linux·网络·python·django·pygame