无法使用python selenium webdriver访问站点

无法使用python selenium webdriver访问站点,python,selenium,web-scraping,selenium-chromedriver,bots,Python,Selenium,Web Scraping,Selenium Chromedriver,Bots,我一直在尝试建立一个通用刮刀。但不知何故,有一些网站,我无法访问的某些原因 我尝试使用互联网上的各种选项来确保我避开了机器人检测标志,但不知何故,网站显然“检测”到我是一个机器人 以下是我一直在使用的选项 ```options.add_argument("--disable-blink-features") options.add_argument("--disable-blink-features=AutomationControlled") optio

我一直在尝试建立一个通用刮刀。但不知何故,有一些网站,我无法访问的某些原因

我尝试使用互联网上的各种选项来确保我避开了机器人检测标志,但不知何故,网站显然“检测”到我是一个机器人

以下是我一直在使用的选项

```options.add_argument("--disable-blink-features")
options.add_argument("--disable-blink-features=AutomationControlled")
options.add_argument("user-data-dir=" + r'C:\Users\JEGSTUDIO\AppData\Local\Google\Chrome\selenium')
options.add_argument("window-size=1280,800")
options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)```
我看到并比较了cookies,看起来这个站点正在使用基于cookie命名的Cloudflare js

这是完整的代码,你们可以试试

```from selenium import webdriver

options = webdriver.ChromeOptions()

options.add_argument("--disable-blink-features")
options.add_argument("--disable-blink-features=AutomationControlled")
options.add_argument("user-data-dir=" + r'C:\Users\JEGSTUDIO\AppData\Local\Google\Chrome\selenium')
options.add_argument("window-size=1280,800")
options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)

driver = webdriver.Chrome(options=options, executable_path=r'C:\Users\JEGSTUDIO\Gochi\Scraping Project\Scraper - AITOPIA v2\chromedriver88crack.exe')

driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})")

driver.get("https://google.com")

input('Next site')

driver.get("https://www.harrods.com/")

input('enter to quit')

driver.quit()```
任何线索都将不胜感激

options.add_argument("--remote-debugging-port=9222")

options.add_argument(
    "user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36")
options.add_experimental_option("excludeSwitches", ["enable-automation"])



driver = webdriver.Chrome(options=options)

driver.maximize_window()


driver.get("https://www.harrods.com/")
添加远程调试端口可以使站点正常工作