How to mannually start chromedriver

For some websites, using default chromedriver will be detected and blocked.
To avoid this, we need to start chrome and chromdriver manually.

In Windows

  1. Close all chrome browsers

  2. In the Chrome location open a terminal and enter

chrome.exe --remote-debugging-port=9222
{% asset_img "cmd.PNG" %}
  1. To make sure it works open browser with 127.0.0.1:9222/json it should display
{% asset_img "localhost.PNG" %}

Configure Chrome Option

from selenium.webdriver.chrome.options import Options

chrome_option = Options()
chrome_option.add_argument("--disable-extensions")
chrome_option.add_experimental_option("debuggerAddress", "127.0.0.1:9222")

Add Chrome Option to the Driver, Now we can control the chrome driver with the current instance

curr_path = os.path.dirname(os.path.realpath("__file__"))

chrome_path = "/".join([curr_path,"cd","chromedriver.exe"])
driver = webdriver.Chrome(chrome_path, options=chrome_option)

   Reprint policy


《How to mannually start chromedriver》 by Isaac Zhou is licensed under a Creative Commons Attribution 4.0 International License
  TOC