emre-gon / selenium.webdriver.undetectedchromedriver Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
How run UndetectedChromeDriver with ChromeOptions?
using (var driver = UndetectedChromeDriver.Instance())
dostum merhaba. bi otomasyon yazıyorum da otomatik captcha ben normal bi skeilde webdriver kullanırken ITakesScreenshot interfacesini kullandıgımda sorunsuz sayfa ekran görüntüsü çekebiliorum ama senın nuget paketini kullanıp , herhangi bir sayfa açtıgımda bunu tanımladıgım şekilde çekerken hata alıyorum
Kodlar şöyle:
public SlDriver WebDriver;
WebDriver = UndetectedChromeDriver.Instance("Profile_" + Form1.RandomString(16));
WebDriver.DriverArguments.Add("--remote-debugging-port=" + Form1.RandomInt(4));
WebDriver.GoTo("https://www.google.com");
public void TakeScreenshot(SlDriver driver)
{
try
{
Screenshot ss = ((ITakesScreenshot)driver).GetScreenshot();
ss.SaveAsFile(Application.StartupPath + @"\captchapng.jpg", OpenQA.Selenium.ScreenshotImageFormat.Jpeg);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
şöyle bi hata alıyorum:
Exception thrown: 'System.InvalidCastException' in maltaAutomation.exe
Unable to cast object of type 'Selenium.WebDriver.UndetectedChromeDriver.UndetectedChromeDriver' to type 'OpenQA.Selenium.ITakesScreenshot'.
epey uğraştım senin nuget paketini indirip düzenlemeye ama, senin paketine .getScreenshot diye bi komut ekleme şansın ya da paketini nasıl indirip düzenleyebilecegimi kısaca anlatırsan ben de yapabilriim. teşekkürler simdiden
Please someone give me an example of how to start. I'm getting errors and have no idea how to start.
Can anyone suggest a code to get started that works?
using OpenQA.Selenium.Chrome;
using Selenium.WebDriver.UndetectedChromeDriver;
using Sl.Selenium.Extensions.Chrome;
using System.Reflection;
namespace Botnet
{
internal class Program
{
static void Main(string[] args)
{
ChromeOptions options = new ChromeOptions();
options.BinaryLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\ChromeDrivers\undetected_chromedriver.exe";
UndetectedChromeDriver.ENABLE_PATCHER = true;
using (var driver = UndetectedChromeDriver.Instance("profile_name", options, TimeSpan.FromSeconds(10)))
{
driver.GoTo("https://nowsecure.nl");
driver.RandomWait(5, 7);
if (driver.GetTextOf("h1") == "OH YEAH, you passed!")
{
Console.WriteLine("OH YEAH, you passed!");
}
else
{
Console.WriteLine("Did not work!");
}
}
Console.ReadLine();
}
}
}
OpenQA.Selenium.WebDriverException: 'unknown error: Chrome failed to start: was killed.
(unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location
C:\Users\guilh\OneDrive\Projetos\.NET\bot-net\bot-net\bin\Debug\net6.0\ChromeDrivers\undetected_chromedriver.exe
is no longer running, so ChromeDriver is assuming that Chrome has crashed.)'
pleas add
CreateBaseDriver()
var driver = new OpenQA.Selenium.Chrome.ChromeDriver(service, options); ->
var driver = new OpenQA.Selenium.Chrome.ChromeDriver(service, options, TimeSpan.FromSeconds(value));
I use your driver, I have a problem when loading a file through the browser, an error appears.
TimedOut after 60 seconds
I tried adding it manually but nothing helps!
ISet drv = new HashSet();
drv.Add("--no-sandbox");
driver = UndetectedChromeDriver.Instance(drv, opt, Patch + //proffile", false);
driver.Manage().Timeouts().ImplicitWait.Add(TimeSpan.FromSeconds(6000));
driver.Manage().Timeouts().PageLoad.Add(TimeSpan.FromSeconds(6000));
Or can you decide differently?
Hi,
I am using this library in one of my projects and I noticed that after chrome updated itself to version 116.0.5845.111, it seems like the library was unable to download a matching Chrome driver, to be modified so it's undetected.
This is the error I am getting:
This version of ChromeDriver only supports Chrome version 114
Current browser version is 116.0.5845.111
This has been super useful thank you.
That being said I think the original version has been updated since your latest release; any idea when you might be able to get the updated version in the nuget package?
This issue in particular will be helpful to have solved:
ultrafunkamsterdam/undetected-chromedriver#986
hocam excluded arguments nasıl ekleyebilirim mesela, chrome download directory'i
AddExcludedArguments olarak eklmem lazım.
Console output:
Initializing connections...
ChromeDriver was started successfully.
Starting ChromeDriver 100.0.4896.60 (6a5d10861ce8de5fce22564658033b43cb7de047-refs/branch-heads/4896@{#875}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
Invalid --log-level value.
Unable to initialize logging. Exiting...
My code
var options = new ChromeOptions();
options.AddArguments(
"--no-first-run",
"--no-default-browser-check",
"--disable-features=ChromeWhatsNewUI",
"--disable-blink-features=AutomationControlled",
"--remote-debugging-port=9222",
"--disable-dev-shm-usage",
"--disable-gpu",
"--no-sandbox",
"--ignore-certificate-errors",
"--disable-setuid-sandbox",
"--disable-infobars",
"--no-service-autorun",
"--no-zygote",
"--mute-audio",
"--disable-accelerated-2d-canvas",
"--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.3");
options.BinaryLocation = @".local-chromium\Win64-970485\chrome-win\chromedriver.exe";
_undetectedChromeDriver =
Selenium.WebDriver.UndetectedChromeDriver.UndetectedChromeDriver.Instance("test", options);
how to use this parameter userDataDir?
options.AddArgument("user-data-dir="+ userDataDir);
not work
I'm working in project build with framework .NET 4.8, your project working fine, But Chromedriver window still shown untill the Driver.Quit;
Can you please guide me to solve this issue?
referenced to #5
Hi,
I like this package and it is working fine with the systems we are using for automation, but I want to run this on a grid having multiple nodes, is that supported with this package, if not, can somebody tell me how we can achieve it?
Hello,
I just downloaded your library and I am facing this issue and a similar one. I am using the selenium.webdriver 4.1.0 version. Which version should I have?
i donwload then add
Imports Selenium.WebDriver.UndetectedChromeDriver
Version 3.141.0
Dim options As ChromeOptions = New ChromeOptions()
Dim driverService = ChromeDriverService.CreateDefaultService()
driverService.HideCommandPromptWindow = True
driverService.SuppressInitialDiagnosticInformation = True
options.AddArgument(“”)..........
Dim driver = New ChromeDriver(driverService, options)
driver.Navigate().GoToUrl("")
don't know UndetectedChromeDriver
how to insert i want bypass
Redirecting…
DDoS protection by [Cloudflare]
have c# or vb.net full example? want, thanks.
how can i replace your plugin with this (how to switch from using Selenium.WebDriver.ChromeDriver to Selenium.WebDriver.UndetectedChromeDriver)
Please Check chromedriver param
Thank You For Your Support. @emre-gon
Couldn’t sign you in
This browser or app may not be secure. Learn more
Try using a different browser. If you’re already using a supported browser, you can try again to sign in.
When I use chromedriver
ChromeOptions options = new ChromeOptions();
options.AddUserProfilePreference("credentials_enable_service", false);
options.AddUserProfilePreference("profile.password_manager_enabled", false);
How to disable password_manager by use UndetectedChromeDriver?
like OpenQA.Selenium.Chrome.ChromeDriver https://stackoverflow.com/a/70218124/17287495
selenium/dotnet/src/webdriver/DevTools/IDevTools.cs
or implement GetDevToolsSession() in Sl.Selenium.Extensions.ChromeDriver / sldriver when is SlDriverBrowserType.Chrome.
Right now I can only do it by downloading all 3 projects and changing
(Selenium.Extensions.SLDriver.cs _baseDriver)
WebDriver _baseDriver; to ChromiumDriver _baseDriver;
and adding
public OpenQA.Selenium.DevTools.DevToolsSession GetDevToolsSession()
{
return _baseDriver.GetDevToolsSession();
}
Something like this, or however you prefer:
public class TestSlChromeDriver
{
public TestSlChromeDriver()
{
ChromeDriver.KillAllChromeProcesses();
Driver = ChromeDriver.Instance();
}
public SlDriver Driver { get; private set; }
public void Start()
{
Driver.GoTo("https://google.com");
try
{
//ChromeDriver(SlDriver) no implement IDevTools
if (Driver is ChromeDriver chromeDriver &&
chromeDriver is IDevTools devTools)
{
IDevToolsSession session = devTools.GetDevToolsSession();
//....
}
}
catch (Exception ex)
{
}
}
}
Hi! undetected chrome driber doesnt work with chrome 108 version
when ypu can update?
Hello.
I was trying to use this library to bypass CloudFare detection. When I tried to use driver in normal mode everything is OK, but then I pass headless flag I got an error in FindElement after 60sec timeout
Here is my code snippet:
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using Selenium.WebDriver.UndetectedChromeDriver;
using (var driver = UndetectedChromeDriver.Instance("Пользователь 1", true))
{
driver.GoTo("https://nowsecure.nl");
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(180);
driver.FindElement(By.XPath(@"/html/body/div[2]/div/main/p[2]/a"));
}
Console.ReadKey();
Chrome version: 103.0.5060.134
Maybe you have some ideas how to bypass cloudfare in headless mode?
Thanks in advance,
how to use
ChromeOptions options = new ChromeOptions();
options.BinaryLocation = pathChromes;
Thanks !!!!!!!!!!!!!!!!!!!
How may I specify the location? Unable to do this with UndetectedChromeDriver
I want to choose binarylocation to open it with custom browser based on chromium , for example brave , edge ...!
Also, I ask if there an option to set custom chromedriver version ?
I'm so sorry I'm newbie in c#!
Thank You in advance !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.