Selenium 问卷星智能检测屏蔽,配置代码如下:

option = webdriver.ChromeOptions()
# option.add_experimental_option("detach", True)
option.add_experimental_option("excludeSwitches", ['enable-automation'])
option.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=option)
driver.execute_cdp_cmd('Network.setUserAgentOverride', {"userAgent": 'Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) > AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D257 > MicroMessenger/6.0.1 NetType/WIFI'})
driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {"source": "Object.defineProperty(navigator, 'webdriver', {get: () => undefined})"})
driver.get('https://ks.wjx.top/vm/mM*****QN.aspx')
最后修改:2021 年 07 月 27 日 09 : 39 AM
☕️ 小站维护不易,打赏一杯咖啡可好?