1.启动本地的浏览器,并且使用本地的用户配置

C:\Program Files\Google\Chrome\Application\chrome.exe --remote-debugging-port=9222 --user-data-dir="C:\data\9222"

2,添加代理

C:\Users\zhaoqingkai\AppData\Local\Google\Chrome\Application\chrome.exe --proxy-server=127.0.0.1:8080 --ignore-certificate-errors 

 

3.python调用

from selenium import webdriver
url='https://www.zhihu.com/question/274767796'
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('lang=zh-CN,zh,zh-TW,en-US,en')
chrome_options.add_experimental_option("debuggerAddress", "127.0.0.1:9222")
driver = webdriver.Chrome(chrome_options=chrome_options)

相关文章:

  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-04
  • 2021-10-10
  • 2021-11-18
  • 2022-01-14
  • 2021-11-08
相关资源
相似解决方案