fysh711426 / UndetectedChromeDriver

GNU General Public License v3.0
166 stars 60 forks source link

Why is there no way to call DebuggerAddress successfully? I want to keep calling UndetectedChromeDriver after the program is closed and restarted #46

Open aimaxapp opened 1 year ago

aimaxapp commented 1 year ago

How should I call, I want to continue to call the object after the program is closed

options.AddArgument($"--remote-debugging-port=9222"); var ChromeGoGo = UndetectedChromeDriver.Create( driverExecutablePath: new ChromeDriverInstaller().Auto().Result, hideCommandPromptWindow: true, options: options, userDataDir: testlocal );

I tried the above code settings, and then used it, but I didn't succeed in jumping to the webpage. Why? how should i write

try { ChromeOptions options = new ChromeOptions(); options.DebuggerAddress = $"127.0.0.1:9222"; UndetectedChromeDriver ChromeGoGo = UndetectedChromeDriver.Create( driverExecutablePath: new ChromeDriverInstaller().Auto().Result, hideCommandPromptWindow: true, options: options ); ChromeGoGo.Navigate().GoToUrl("https://www.yahoo.com.tw"); catch(Exception e) { MessageBox.Show(e.Message); }

image

fysh711426 commented 1 year ago

Can't set --remote-debugging, the interior of the repo has been used.

aimaxapp commented 1 year ago

Then how should I continue to call UndetectedChromeDriver after the program is closed and restarted, thank you

fysh711426 commented 1 year ago

No way, you look at this. https://github.com/fysh711426/UndetectedChromeDriver/blob/master/UndetectedChromeDriver/UndetectedChromeDriver.cs#L86