python - 带有权限策略的无头 Chrome 错误
问题描述
如何使用硒以无头模式打开chrome?我试过了
chromeOptions = Options()
chromeOptions.add_argument("--headless")
self.driver = webdriver.Chrome(ChromeDriverManager().install(), chrome_options=chromeOptions)
但这只会返回一个错误:
Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'.", source: (0)
此外,它会将我重定向到一个网页,上面写着“Cloudfare 提供的 DDOS 保护。请等待 5 秒”,而不是获取我想要的网页。
解决方案
推荐阅读
- selenium - Selenium web element - 获取元素id并在循环中迭代
- python - 一维卷积神经网络输入形状问题
- python - 如何更快地使用 FuncAnimation 保存动画?
- flutter - Flutter with tensorflow - 无法从形状为 [1, 1] 的 TensorFlowLite 张量(身份)复制到形状为 [1, 2] 的 Java 对象
- git - Docker 命令在 Windows 上的 Git Bash 中不起作用(执行:“com.docker.cli”:在 %PATH% 中找不到可执行文件)
- python - 比较空数组
- javascript - 在邮递员中创建令牌
- c# - .NET Observable 封装在一个类中以在接口上公开另一个 Observable
- java - 没有volatile的双重检查锁错了?
- linux - 为什么 ld-linux-x86-64.so.2 链接到意外位置?