3-selenium反爬了,网页打开一直提示失败

发布时间 2023-05-04 18:42:07作者: 小排顾

添加如下代码

from selenium.webdriver import ChromeOptions
option = ChromeOptions()
option.add_experimental_option('excludeSwitches', ['enable-automation'])
option.add_argument("disable-blink-features=AutomationControlled")

driver = webdriver.Chrome("chromedriver",0,options=option)
driver.get("https://www.xiaohongshu.com")