当前位置:网站首页>[爬虫]使用selenium时,躲避脚本检测
[爬虫]使用selenium时,躲避脚本检测
2022-07-07 10:33:00 【大西瓜和小栗子】
问题现象
在一次脚本尝试登陆中有一个滑块,不管怎么拖动,它都会报错误。即使是脚本填入数据,你自己拖动滑块也会一直报错。
问题解决
这个问题主要是由于应用对脚本做了检测。检测的依据是
window.navigator.webdriver
以下这张图是修改后的,没设置前都是返回true.
在请求页面的时候,先把options设置一下。以下代码只对chrome 88版以上有用。
脚本
from selenium.webdriver.chrome.options import Options
option = Options()
option.add_argument('--disable-blink-features=AutomationControlled')
web = Chrome(options=option)
web.get("https://www.baidu.com")
边栏推荐
- 【PyTorch实战】图像描述——让神经网络看图讲故事
- The hoisting of the upper cylinder of the steel containment of the world's first reactor "linglong-1" reactor building was successful
- TypeScript 接口继承
- Airserver automatically receives multi screen projection or cross device projection
- 2022聚合工艺考试题模拟考试题库及在线模拟考试
- Simple network configuration for equipment management
- ES底层原理之倒排索引
- 免备案服务器会影响网站排名和权重吗?
- Charles: four ways to modify the input parameters or return results of the interface
- (待会删)yyds,付费搞来的学术资源,请低调使用!
猜你喜欢
Processing strategy of message queue message loss and repeated message sending
AirServer自动接收多画面投屏或者跨设备投屏
Unity map auto match material tool map auto add to shader tool shader match map tool map made by substance painter auto match shader tool
金融数据获取(三)当爬虫遇上要鼠标滚轮滚动才会刷新数据的网页(保姆级教程)
Static comprehensive experiment
Simple network configuration for equipment management
idm服务器响应显示您没有权限下载解决教程
Hi3516 full system type burning tutorial
Static routing assignment of network reachable and telent connections
[statistical learning method] learning notes - support vector machine (Part 2)
随机推荐
Preorder, inorder and postorder traversal of binary tree
Niuke website
Static vxlan configuration
ENSP MPLS layer 3 dedicated line
TypeScript 接口继承
The left-hand side of an assignment expression may not be an optional property access. ts(2779)
Utiliser la pile pour convertir le binaire en décimal
消息队列消息丢失和消息重复发送的处理策略
EPP+DIS学习之路(2)——Blink!闪烁!
About sqli lab less-15 using or instead of and parsing
Customize the web service configuration file
SQL lab 21~25 summary (subsequent continuous update) (including secondary injection explanation)
免备案服务器会影响网站排名和权重吗?
【二叉树】删点成林
Aike AI frontier promotion (7.7)
DOM parsing XML error: content is not allowed in Prolog
Multi row and multi column flex layout
File upload vulnerability - upload labs (1~2)
Cookie
sql-lab (54-65)