有没有办法在使用 seleniumrequest 模块时设置 chrome 选项?

问题描述

我的目标是使用 seleniumrequest 模块发出请求。这工作正常。但是现在我经常收到比普通验证码更难的验证码。所以我假设该站点能够检测到我使用硒。所以下一步是我更改 Chrome 选项并禁用我使用自动化软件的“属性”。我知道如何单独为 selenium 做到这一点,但 seleniumrequest 似乎不支持。有人可以确认这一点,或者可以告诉我我做错了什么。

from seleniumrequests import Chrome

webdriver = Chrome()

option = webdriver.ChromeOptions()

option.add_argument("--disable-blink-features=AutomationControlled")

webdriver = webdriver.Chrome(executable_path=r"chromedriver.exe",options=option)``` 

解决方法

option.add_experimental_option("excludeSwitches",["enable-automation"])

将是关闭自动化软件的选项。

ChromeOptions 也已弃用,而是使用 Options。

from selenium.webdriver.chrome.options import Options
option = Options()