Selenium.WebDriver.UndetectedChromeDriver icon indicating copy to clipboard operation
Selenium.WebDriver.UndetectedChromeDriver copied to clipboard

userDataDir

Open mahdisky opened this issue 3 years ago • 8 comments

how to use this parameter userDataDir?

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

not work

mahdisky avatar Oct 23 '22 10:10 mahdisky

ISet<string> driverarguments = new HashSet<string>();
            string thisdir= Environment.CurrentDirectory + @"\";
            string dirAllUsers = thisdir + "usersdata"+ @"\";
            string username_sanitize = "pepe";
            string full_path = dirAllUsers + username_sanitize;
            if (!Directory.Exists(full_path))
            {
                Directory.CreateDirectory(full_path);
            }
            driverarguments.Add("user-data-dir=" + full_path);
            Sl.Selenium.Extensions.Chrome.ChromeDriverParameters chromeDriverParameters = new()
            {
                Headless = false,
                DriverArguments = driverarguments,
                Timeout = new TimeSpan(0, 0, 22)
             
            };
Driver = UndetectedChromeDriver.Instance(chromeDriverParameters);

chrome://version/ Sin título

firecrauter avatar Oct 23 '22 15:10 firecrauter

ISet<string> driverarguments = new HashSet<string>();
            string thisdir= Environment.CurrentDirectory + @"\";
            string dirAllUsers = thisdir + "usersdata"+ @"\";
            string username_sanitize = "pepe";
            string full_path = dirAllUsers + username_sanitize;
            if (!Directory.Exists(full_path))
            {
                Directory.CreateDirectory(full_path);
            }
            driverarguments.Add("user-data-dir=" + full_path);
            Sl.Selenium.Extensions.Chrome.ChromeDriverParameters chromeDriverParameters = new()
            {
                Headless = false,
                DriverArguments = driverarguments,
                Timeout = new TimeSpan(0, 0, 22)
             
            };
Driver = UndetectedChromeDriver.Instance(chromeDriverParameters);

chrome://version/ Sin título

@firecrauter i think u forgot something at Sl.Selenium.Extensions.Chrome.ChromeDriverParameters chromeDriverParameters = new() xxxxxxxxxxxxx;

RifHut avatar Nov 02 '22 23:11 RifHut

@RifHut i think u forgot something at Sl.Selenium.Extensions.Chrome.ChromeDriverParameters chromeDriverParameters = new() xxxxxxxxxxxxx;

The code works for me, what do you think is missing? (It was in the previous update, I don't know if anything has changed)

firecrauter avatar Nov 02 '22 23:11 firecrauter

new()

missing new ChromeDriverParameters() !?

RifHut avatar Nov 03 '22 12:11 RifHut

new()

missing new ChromeDriverParameters() !?

image Need c# 9 or greater.

try this:

            Sl.Selenium.Extensions.Chrome.ChromeDriverParameters chromeDriverParameters = new();
            chromeDriverParameters.Timeout = new TimeSpan(0, 0, 22);
            chromeDriverParameters.DriverArguments = driverarguments;
            chromeDriverParameters.Headless = false;

firecrauter avatar Nov 03 '22 16:11 firecrauter

Sl.Selenium.Extensions.Chrome.ChromeDriverParameters chromeDriverParameters = new(); chromeDriverParameters.Timeout = new TimeSpan(0, 0, 22); chromeDriverParameters.DriverArguments = driverarguments; chromeDriverParameters.Headless = false;

Yes u are right dude , I'm Working in Old Project with .Net framework v4.8 , that's why I get errors, image

All Ok with framework v4.8 , but still detected on cloudflare , the example in this project "Tests" work fine. (net 6.0).

2 - also the shell window of undetect_chromedrive.exe still showing !

Thank You!

RifHut avatar Nov 03 '22 22:11 RifHut

Yes u are right dude , I'm Working in Old Project with .Net framework v4.8 , that's why I get errors

All Ok with framework v4.8 , but still detected on cloudflare , the example in this project "Tests" work fine. (net 6.0). 2 - also the shell window of undetect_chromedrive.exe still showing !

Thank You!

just in case, there is openbulletv2, which is being updated and uses net6

firecrauter avatar Nov 04 '22 01:11 firecrauter

Yes u are right dude , I'm Working in Old Project with .Net framework v4.8 , that's why I get errors All Ok with framework v4.8 , but still detected on cloudflare , the example in this project "Tests" work fine. (net 6.0). 2 - also the shell window of undetect_chromedrive.exe still showing ! Thank You!

just in case, there is openbulletv2, which is being updated and uses net6

You are right that's what i

Yes u are right dude , I'm Working in Old Project with .Net framework v4.8 , that's why I get errors All Ok with framework v4.8 , but still detected on cloudflare , the example in this project "Tests" work fine. (net 6.0). 2 - also the shell window of undetect_chromedrive.exe still showing ! Thank You!

just in case, there is openbulletv2, which is being updated and uses net6

I previously developed this SB project, but it has an old framework, the best I would do is moving to OB2, thanks dude. i'm newbie at c# , i'm so sorry :) !

RifHut avatar Nov 04 '22 13:11 RifHut