当前位置:网站首页>[爬虫]使用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")
边栏推荐
- Tutorial on principles and applications of database system (010) -- exercises of conceptual model and data model
- 数据库系统原理与应用教程(010)—— 概念模型与数据模型练习题
- 【统计学习方法】学习笔记——支持向量机(下)
- Customize the web service configuration file
- In the small skin panel, use CMD to enter the MySQL command, including the MySQL error unknown variable 'secure_ file_ Priv 'solution (super detailed)
- College entrance examination composition, high-frequency mention of science and Technology
- AirServer自动接收多画面投屏或者跨设备投屏
- 普乐蛙小型5d电影设备|5d电影动感电影体验馆|VR景区影院设备
- Tutorial on the principle and application of database system (011) -- relational database
- [statistical learning method] learning notes - support vector machine (Part 2)
猜你喜欢
How to use PS link layer and shortcut keys, and how to do PS layer link
Vxlan static centralized gateway
Solutions to cross domain problems
leetcode刷题:二叉树25(二叉搜索树的最近公共祖先)
普乐蛙小型5d电影设备|5d电影动感电影体验馆|VR景区影院设备
The hoisting of the upper cylinder of the steel containment of the world's first reactor "linglong-1" reactor building was successful
2022广东省安全员A证第三批(主要负责人)考试练习题及模拟考试
Tutorial on principles and applications of database system (010) -- exercises of conceptual model and data model
SQL head injection -- injection principle and essence
Static comprehensive experiment
随机推荐
(待会删)yyds,付费搞来的学术资源,请低调使用!
SQL head injection -- injection principle and essence
Static routing assignment of network reachable and telent connections
Zhimei creative website exercise
On valuation model (II): PE index II - PE band
What if does not match your user account appears when submitting the code?
Sort out the garbage collection of JVM, and don't involve high-quality things such as performance tuning for the time being
When OSPF specifies that the connection type is P2P, it enables devices on both ends that are not in the same subnet to Ping each other
解决 Server returns invalid timezone. Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually
SQL lab 1~10 summary (subsequent continuous update)
Typescript interface inheritance
Customize the web service configuration file
Dialogue with Wang Wenyu, co-founder of ppio: integrate edge computing resources and explore more audio and video service scenarios
SQL lab 11~20 summary (subsequent continuous update) contains the solution that Firefox can't catch local packages after 18 levels
Tutorial on the principle and application of database system (011) -- relational database
gcc 编译报错
SQL blind injection (WEB penetration)
EPP+DIS学习之路(1)——Hello world!
SQL Lab (46~53) (continuous update later) order by injection
Sign up now | oar hacker marathon phase III midsummer debut, waiting for you to challenge