selenium给chrome driver 添加启动参数出现拒绝访问

img
给chrome driver 添加启动参数,应该是要加读写权限,俺不会,来个大佬修修补补!

你想调用特定端口的chrome吧, 你需要这样添加。


path = 'chromedriver.exe'
os.system('start chrome --remote-debugging-port=8210 --user-data-dir="C:\chrome_config')    #如果不调用端口chrome就注释
options = webdriver.ChromeOptions()
options.debugger_address = '127.0.0.1:8210' #如果不调用端口chrome就注释
# options.add_argument('--headless')  # 隐身模式
options.add_argument("--disable-blink-features")
options.add_argument("--disable-blink-features=AutomationControlled")
options.add_argument('ignore-certificate-errors')
driver = webdriver.Chrome(options=options,executable_path=path)  # 新版本用options参数,chrome_options即将弃用
#登录页
driver.get("****")