0

如何使用硒以无头模式打开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 秒”,而不是获取我想要的网页。

4

0 回答 0