【问题标题】:Is there a way to set chrome options when using the seleniumrequest module?使用 seleniumrequest 模块时有没有办法设置 chrome 选项?
【发布时间】:2021-03-11 10:40:51
【问题描述】:

我的目标是使用 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)``` 

【问题讨论】:

    标签: selenium request selenium-chromedriver chrome-options


    【解决方案1】:
    option.add_experimental_option("excludeSwitches", ["enable-automation"])
    

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

    ChromeOptions 也已被贬值,请改用 Options。

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

    【讨论】:

    • 没问题,如果有帮助,请勾选我的答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-11
    • 1970-01-01
    • 2011-03-28
    • 1970-01-01
    • 1970-01-01
    • 2020-11-25
    • 1970-01-01
    相关资源
    最近更新 更多