Open ManabBala opened 1 year ago
Start the browser on the port then use this:
import os
import undetected_chromedriver as uc
options = uc.ChromeOptions()
options.debugger_address = '127.0.0.1:9222'
driver = uc.Chrome(options=options)
os.kill(driver.browser_pid, 15)
undetected-chromedriver connects to the existing browser then starts a browser on a random port, this closes the random browser
You actually can connect to a uc driver, just start a uc driver, then get get it debugaddress:
driverToBeControlled = uc.Chrome()
debugaddress = driverToBeControlled.options.debugger_address
then save it to a file, or just copy paste it and start another uc driver
opt = uc.ChromeOptions() # or default selenium ChromeOptions
opt.debugger_address = debugaddress
driverThatControls = uc.Chrome(options= opt) # or default selenium ChromeDriver
Than you can send commands to driverThatControls, and driverToBeControlled will actually execute them.
Problem is, by doing so, your driver becomes not secure, and sites see it as a Selenium controlled driver.
This is my old code:
what i do with this:
can't Do this with Undetected chromedriver:
What I need: