当前位置:网站首页>[爬虫]使用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")
边栏推荐
- Ctfhub -web SSRF summary (excluding fastcgi and redI) super detailed
- leetcode刷题:二叉树20(二叉搜索树中的搜索)
- 【PyTorch实战】用RNN写诗
- Tutorial on principles and applications of database system (007) -- related concepts of database
- Dialogue with Wang Wenyu, co-founder of ppio: integrate edge computing resources and explore more audio and video service scenarios
- (待会删)yyds,付费搞来的学术资源,请低调使用!
- Tutorial on the principle and application of database system (008) -- exercises on database related concepts
- About IPSec
- Tutorial on the principle and application of database system (011) -- relational database
- 浅谈估值模型 (二): PE指标II——PE Band
猜你喜欢

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

解决 Server returns invalid timezone. Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually

idm服务器响应显示您没有权限下载解决教程

RHSA first day operation

爱可可AI前沿推介(7.7)

Airserver automatically receives multi screen projection or cross device projection

JS to convert array to tree data

Idea 2021 Chinese garbled code

Dialogue with Wang Wenyu, co-founder of ppio: integrate edge computing resources and explore more audio and video service scenarios

Hi3516 full system type burning tutorial
随机推荐
爱可可AI前沿推介(7.7)
利用栈来实现二进制转化为十进制
[pytorch practice] image description -- let neural network read pictures and tell stories
Aike AI frontier promotion (7.7)
密码学系列之:在线证书状态协议OCSP详解
College entrance examination composition, high-frequency mention of science and Technology
金融数据获取(三)当爬虫遇上要鼠标滚轮滚动才会刷新数据的网页(保姆级教程)
What if does not match your user account appears when submitting the code?
Pule frog small 5D movie equipment | 5D movie dynamic movie experience hall | VR scenic area cinema equipment
Static routing assignment of network reachable and telent connections
数据库系统原理与应用教程(007)—— 数据库相关概念
【统计学习方法】学习笔记——提升方法
BGP third experiment report
编译 libssl 报错
【统计学习方法】学习笔记——第五章:决策树
数据库系统原理与应用教程(010)—— 概念模型与数据模型练习题
【PyTorch实战】用RNN写诗
SQL lab 26~31 summary (subsequent continuous update) (including parameter pollution explanation)
EPP+DIS学习之路(2)——Blink!闪烁!
File upload vulnerability - upload labs (1~2)