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/

相关推荐
zhousenshan28 分钟前
Python爬虫常用框架
开发语言·爬虫·python
IMER SIMPLE1 小时前
人工智能-python-深度学习-经典神经网络AlexNet
人工智能·python·深度学习
CodeCraft Studio1 小时前
国产化Word处理组件Spire.DOC教程:使用 Python 将 Markdown 转换为 HTML 的详细教程
python·html·word·markdown·国产化·spire.doc·文档格式转换
测试老哥2 小时前
6个步骤实现Postman接口压力测试
自动化测试·软件测试·测试工具·测试用例·接口测试·压力测试·postman
专注API从业者2 小时前
Python/Java 代码示例:手把手教程调用 1688 API 获取商品详情实时数据
java·linux·数据库·python
java1234_小锋2 小时前
[免费]基于Python的协同过滤电影推荐系统(Django+Vue+sqlite+爬虫)【论文+源码+SQL脚本】
python·django·电影推荐系统·协同过滤
deepwater_zone2 小时前
网络爬虫(web crawler)
爬虫
看海天一色听风起雨落2 小时前
Python学习之装饰器
开发语言·python·学习
XiaoMu_0013 小时前
基于Python+Streamlit的旅游数据分析与预测系统:从数据可视化到机器学习预测的完整实现
python·信息可视化·旅游
THMAIL3 小时前
深度学习从入门到精通 - 生成对抗网络(GAN)实战:创造逼真图像的魔法艺术
人工智能·python·深度学习·神经网络·机器学习·生成对抗网络·cnn