Selenium 被反爬 报400 打不开

直接使用第三方开源的driver undetected-chromedriver

开源地址:https://github.com/ultrafunkamsterdam/undetected-chromedriver

它自带一些常见的因为浏览器环境问题被反爬的反反爬配置,可以规避部分风控。

使用

1、安装依赖

python 复制代码
pip install undetected-chromedriver

2、替换原生的Selenium

python 复制代码
import undetected_chromedriver as uc
driver = uc.Chrome(headless=True,use_subprocess=False)
driver.get('https://nowsecure.nl')
driver.save_screenshot('nowsecure.png')

完成

经测试,某知识产权网可用

附带浏览器环境检测网址:https://bot.sannysoft.com/

相关推荐
高洁0115 分钟前
多源数据融合:把零散信号拼成一致图景
人工智能·python·机器学习·transformer·迁移学习
郝学胜-神的一滴27 分钟前
Effective Python 条款41:试Mix‑In组合式开发
开发语言·pytorch·python·pycharm·numpy
吃我一窝jio1 小时前
Python与Redis集合深度解析
开发语言·redis·笔记·python
龙腾AI白云3 小时前
多源数据融合:把零散信号拼成一致图景
大数据·人工智能·python·机器学习·知识图谱
艾派森3 小时前
深度学习实战-基于VGG19的健康和白化珊瑚图像分类识别模型
人工智能·python·深度学习·分类
鲸渔3 小时前
【AI Agent系列课程26-Python 基础26】复盘:Python 接口开发知识清单
开发语言·python·ai编程
2401_868534784 小时前
55 个热门网络面试问题及答案
网络·python
aifannihao4 小时前
ON CONFLICT 冲突后返回空:sqlite3 实测 get-or-create
数据库·python·postgresql·sqlite3·标准库
用户0332126663674 小时前
使用 Python 合并 Excel 工作簿
python
__underline__4 小时前
冷门Python知识点008篇:__int__、__index__与__float__,Python数值转换的真实回退顺序?
后端·python