0

I'm trying to connect Selenium to an existing chrome driver I execute this command in cmd "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9878 but when I try to connect to this browser it stuck at webdriver.Chrome(chrome_driver, options=chrome_options) even though it was working.

My code :

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_experimental_option("debuggerAddress", "127.0.0.1:9878")
chrome_driver = "chromedriver.exe"
driver = webdriver.Chrome(chrome_driver, options=chrome_options) # stuck here
driver.get("https://www.google.com/")
monya
  • 1
  • Please try `"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9878 --user-data-dir="C:\selenium\ChromeProfile` and let me know – Nandan A Nov 16 '21 at 17:52
  • You will need to get the sessionID from the first chromedriver, then use that in the 2nd. (Note: I think when you initiate the 2nd chromedriver it will always start a new browser... so you'll have a sort of orphaned browser there.) – pcalkins Nov 16 '21 at 17:59
  • @pcalkins for this process getting session id is not required because you will be launching chrome by desired port. – Nandan A Nov 16 '21 at 18:05

0 Answers0