Open thenik opened 2 years ago
Only tested on windows. But, except that you need to set the browserExecutablePath by yourself, other functions maby can work normally. If you have problems using it, I will try to fix it.
PM> Install-Package Selenium.UndetectedChromeDriver -Version 1.0.5-alpha
I released a alpha package with some code to support linux or macos, you can try it.
thanks, I tried your 1.0.5-alpha. andit does not work on Linux\ Debian
how to reproduce
// step 1 via Atata Idownload driver var driverSetupResults = DriverSetup.AutoSetUp(BrowserNames.Chrome); Log("driverSetupResults:" + driverSetupResults.DirectoryPath);
_driverPath = Path.Combine(driverSetupResults.DirectoryPath, driverSetupResults.FileName);
//step 2 patch
var p = new SeleniumUndetectedChromeDriver.Patcher(_driverPath); p.Auto();
//step 3
_uDriver.Navigate().GoToUrl(u); //it crashes onLinux and it works on windows
Exception: unknown error: net::ERR_CONNECTION_RESET (Session info: chrome=102.0.5005.61) [2022-06-16 10:15:12] at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse)
I tested the code with a VirtualBox, but the results are confusing. The code is executed successfully, but the chrome screen is stuck and keeps flashing. (Debian and Ubuntu are like this)
var driverExecutablePath = $@"/home/aaa/chromedriver/chromedriver";
var options = new ChromeOptions();
options.AddArgument("--no-sandbox");
options.AddArgument("--mute-audio");
options.AddArgument("--disable-gpu");
options.AddArgument("--disable-dev-shm-usage");
using var driver = UndetectedChromeDriver.Create(
options: options,
driverExecutablePath: driverExecutablePath);
driver.GoToUrl("https://nowsecure.nl");
Console.ReadLine();
Try replacing this.
_uDriver.Navigate().GoToUrl(u);
to
_uDriver.GoToUrl(u);
doesn't work for me either sadly i am using rasberry pi4
public WebDriver()
{
ChromeDriverInitize();
}
protected void ChromeDriverInitize()
{
var options = new ChromeOptions();
options.AddArgument("--disable-dev-shm-usage");
webDriver = UndetectedChromeDriver.Create(options: options,headless: true,
driverExecutablePath: @"/usr/bin/chromedriver");
addCookies();
}
public void GoToSteam(string key)
{
Console.WriteLine(key);
GoToUrl($"https://store.steampowered.com/account/registerkey?key={key}");
Click("//*[@id=\"accept_ssa\"]");
Click("//*[@id=\"register_btn\"]/span");
Dispose();
}
public void GoToUrl(string url)
{
webDriver.GoToUrl(url);
}
Hey!
Does it work with linux \ debian ?
Thanks!