当前位置:网站首页>[爬虫]使用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")
边栏推荐
- 解密GD32 MCU产品家族,开发板该怎么选?
- 2022广东省安全员A证第三批(主要负责人)考试练习题及模拟考试
- On valuation model (II): PE index II - PE band
- [deep learning] image multi label classification task, Baidu paddleclas
- Static routing assignment of network reachable and telent connections
- Multi row and multi column flex layout
- 静态Vxlan 配置
- [statistical learning method] learning notes - support vector machine (I)
- 什么是ESP/MSR 分区,如何建立ESP/MSR 分区
- Processing strategy of message queue message loss and repeated message sending
猜你喜欢
【统计学习方法】学习笔记——第五章:决策树
【PyTorch实战】图像描述——让神经网络看图讲故事
Static vxlan configuration
【统计学习方法】学习笔记——逻辑斯谛回归和最大熵模型
【统计学习方法】学习笔记——支持向量机(上)
Vxlan static centralized gateway
跨域问题解决方案
Financial data acquisition (III) when a crawler encounters a web page that needs to scroll with the mouse wheel to refresh the data (nanny level tutorial)
ES底层原理之倒排索引
Attack and defense world - PWN learning notes
随机推荐
Vxlan 静态集中网关
Is it safe to open an account in Ping An Securities mobile bank?
Tutorial on the principle and application of database system (008) -- exercises on database related concepts
【二叉树】删点成林
Dialogue with Wang Wenyu, co-founder of ppio: integrate edge computing resources and explore more audio and video service scenarios
【统计学习方法】学习笔记——第五章:决策树
GCC compilation error
【深度学习】图像多标签分类任务,百度PaddleClas
File upload vulnerability - upload labs (1~2)
通讯协议设计与实现
Using stack to convert binary to decimal
Tutorial on the principle and application of database system (011) -- relational database
What is an esp/msr partition and how to create an esp/msr partition
[pytorch practice] image description -- let neural network read pictures and tell stories
@What happens if bean and @component are used on the same class?
免备案服务器会影响网站排名和权重吗?
H3C HCl MPLS layer 2 dedicated line experiment
leetcode刷题:二叉树19(合并二叉树)
EPP+DIS学习之路(2)——Blink!闪烁!
[statistical learning methods] learning notes - improvement methods