当前位置:网站首页>[爬虫]使用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")
边栏推荐
- Realize a simple version of array by yourself from
- Zhimei creative website exercise
- SQL Lab (41~45) (continuous update later)
- SQL injection -- Audit of PHP source code (take SQL lab 1~15 as an example) (super detailed)
- gcc 编译报错
- How much does it cost to develop a small program mall?
- GCC compilation error
- OSPF exercise Report
- 平安证券手机行开户安全吗?
- Realize all, race, allsettled and any of the simple version of promise by yourself
猜你喜欢
![[pytorch practice] use pytorch to realize image style migration based on neural network](/img/20/8ed7113115709b6169be289b0c280a.png)
[pytorch practice] use pytorch to realize image style migration based on neural network

IPv6 experiment

H3C HCl MPLS layer 2 dedicated line experiment

SQL lab 21~25 summary (subsequent continuous update) (including secondary injection explanation)

leetcode刷题:二叉树25(二叉搜索树的最近公共祖先)

SQL Lab (41~45) (continuous update later)

SQL Lab (46~53) (continuous update later) order by injection

leetcode刷题:二叉树20(二叉搜索树中的搜索)

Vxlan static centralized gateway

Hi3516 full system type burning tutorial
随机推荐
leetcode刷题:二叉树23(二叉搜索树中的众数)
On valuation model (II): PE index II - PE band
What is an esp/msr partition and how to create an esp/msr partition
浅谈估值模型 (二): PE指标II——PE Band
消息队列消息丢失和消息重复发送的处理策略
[play RT thread] RT thread Studio - key control motor forward and reverse rotation, buzzer
OSPF exercise Report
数据库系统原理与应用教程(011)—— 关系数据库
Realize a simple version of array by yourself from
Upgrade from a tool to a solution, and the new site with praise points to new value
Sign up now | oar hacker marathon phase III midsummer debut, waiting for you to challenge
leetcode刷题:二叉树21(验证二叉搜索树)
Typescript interface inheritance
Tutorial on the principle and application of database system (011) -- relational database
Attack and defense world - PWN learning notes
Vxlan static centralized gateway
leetcode刷题:二叉树19(合并二叉树)
通讯协议设计与实现
The left-hand side of an assignment expression may not be an optional property access. ts(2779)
【深度学习】图像多标签分类任务,百度PaddleClas