Giter Site home page Giter Site logo

selenium.webdriver.undetectedchromedriver's People

Contributors

emre-gon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

selenium.webdriver.undetectedchromedriver's Issues

Selam hocam

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

How to start using?

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?

My Code
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();
        }
    }
}

image

Error:
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.)'

image

selenium timed out after 60 seconds.

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?

Current browser version is 116.0.5845.111 not supported

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

Update?

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

add_excludedarguments

hocam excluded arguments nasıl ekleyebilirim mesela, chrome download directory'i
AddExcludedArguments olarak eklmem lazım.

Error with --log-level

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);

userDataDir

how to use this parameter userDataDir?

options.AddArgument("user-data-dir="+ userDataDir);

not work

excuse me, have c# or vb.net use the UndetectedChromeDriver "example"?

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.

Duplicate window when remote debugging

How to remove this duplicate window when connecting to remote debugging?

options.AddArgument($"--remote-debugging-host=localhost");
options.AddArgument($"--remote-debugging-port={port}");
options.AddArgument($"--devtools-ws-endpoint={wsEndpoint}");

image

How to disable password_manager

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?

How do I get the DevToolsSession?

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)
            {

            }
        }
    }

Chrome 108 version

Hi! undetected chrome driber doesnt work with chrome 108 version
when ypu can update?

Bypass cloudfare detection in headless mode

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

And error:
image

Maybe you have some ideas how to bypass cloudfare in headless mode?

Thanks in advance,

Geolocation

How may I specify the location? Unable to do this with UndetectedChromeDriver

Linux / debian support

Hey Emre!

Does it work with Linux / debian with .net 5.0 ?
I tried to run that but get errors.

Thanks!

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.