【问题标题】:Selenium is being detected even after modifying executable file即使在修改可执行文件后也检测到硒
【发布时间】:2021-04-11 23:41:20
【问题描述】:

所以目前我已经更改了 selenium chrome 驱动程序中的$cdc_ 字符串,并按照网站的建议添加了以下选项。

option = webdriver.ChromeOptions()
option.add_argument('--disable-blind-features=AutomationControlled')
option.add_argument("window-size=1280,800")
option.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36")
driver = webdriver.Chrome(executable_path=PATH, options=option)

此时我不知道还能做什么。该网站的功能允许我的普通 chrome 浏览器继续执行某个点,但是当 selenium 执行相同的功能时,网站的服务器不允许机器人完成它的工作。有什么建议为什么该网站可以检测到硒?

【问题讨论】:

  • 哪个网站?
  • Website 当我 selenium 单击“加入我们”按钮时
  • 你遇到了什么错误
  • 在我的 Linux Selenium 上,此页面无需任何更改即可使用 $cdc_ - 它只需要休眠几秒钟即可等待整页。

标签: python selenium selenium-webdriver selenium-chromedriver bots


【解决方案1】:

使用调试器地址打开chrome:

"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=1560 https://www.nike.com/au/register

然后你就可以连接到现有的chrome浏览器了:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
options = webdriver.ChromeOptions()
#options.add_argument('--disable-automation')
#options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36")

options.add_experimental_option("debuggerAddress", "127.0.0.1:1560")
driver = webdriver.Chrome(options=options)




driver.find_element_by_css_selector('[type="email"]').send_keys("someemail@gmail.com")
driver.find_element_by_css_selector('[type="password"]').send_keys("somepassword")
driver.find_element_by_css_selector('[data-componentname="firstName"]').send_keys("first")
driver.find_element_by_css_selector('[data-componentname="lastName"]').send_keys("last")
driver.find_element_by_css_selector('[data-componentname="dateOfBirth"]').send_keys("20/10/1980")
driver.find_element_by_xpath("//*[@data-componentname='gender']/li[1]").click()
driver.find_element_by_xpath("//*[@value=\"JOIN US\"]").click()

【讨论】:

    猜你喜欢
    • 2017-11-08
    • 1970-01-01
    • 2019-06-15
    • 1970-01-01
    • 1970-01-01
    • 2012-12-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-28
    相关资源
    最近更新 更多