当前位置:网站首页>[爬虫]使用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")
边栏推荐
- 【统计学习方法】学习笔记——第五章:决策树
- [statistical learning method] learning notes - support vector machine (I)
- AirServer自动接收多画面投屏或者跨设备投屏
- 30. Feed shot named entity recognition with self describing networks reading notes
- 【PyTorch实战】图像描述——让神经网络看图讲故事
- idm服务器响应显示您没有权限下载解决教程
- Aike AI frontier promotion (7.7)
- Simple implementation of call, bind and apply
- Epp+dis learning path (1) -- Hello world!
- Epp+dis learning road (2) -- blink! twinkle!
猜你喜欢

30. Feed shot named entity recognition with self describing networks reading notes

IPv6 experiment

【统计学习方法】学习笔记——支持向量机(下)

leetcode刷题:二叉树22(二叉搜索树的最小绝对差)
![[statistical learning method] learning notes - support vector machine (I)](/img/3f/56db88d717d7cd6624b3d0867146e9.png)
[statistical learning method] learning notes - support vector machine (I)

SQL lab 11~20 summary (subsequent continuous update) contains the solution that Firefox can't catch local packages after 18 levels

Cookie

Solve server returns invalid timezone Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually

@What happens if bean and @component are used on the same class?

leetcode刷题:二叉树26(二叉搜索树中的插入操作)
随机推荐
EPP+DIS学习之路(1)——Hello world!
解决 Server returns invalid timezone. Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually
idm服务器响应显示您没有权限下载解决教程
The left-hand side of an assignment expression may not be an optional property access. ts(2779)
2022A特种设备相关管理(锅炉压力容器压力管道)模拟考试题库模拟考试平台操作
H3C HCl MPLS layer 2 dedicated line experiment
Inverted index of ES underlying principle
Configure an encrypted web server
The road to success in R & D efficiency of 1000 person Internet companies
SQL Lab (41~45) (continuous update later)
The IDM server response shows that you do not have permission to download the solution tutorial
Xiaohongshu microservice framework and governance and other cloud native business architecture evolution cases
leetcode刷题:二叉树20(二叉搜索树中的搜索)
RHSA first day operation
leetcode刷题:二叉树25(二叉搜索树的最近公共祖先)
SQL lab 1~10 summary (subsequent continuous update)
Typescript interface inheritance
Using stack to convert binary to decimal
Multi row and multi column flex layout
牛客网刷题网址