Added even more stealth and switched back to chrome but still does not work
This commit is contained in:
+9
-7
@@ -42,11 +42,11 @@ namespace TestChrome
|
|||||||
extra.Use(new StealthPlugin());
|
extra.Use(new StealthPlugin());
|
||||||
|
|
||||||
// Launch the puppeteer browser with plugins
|
// Launch the puppeteer browser with plugins
|
||||||
var browserFetcher = new BrowserFetcher(Product.Firefox);
|
var browserFetcher = new BrowserFetcher(Product.Chrome);
|
||||||
await browserFetcher.DownloadAsync();
|
await browserFetcher.DownloadAsync();
|
||||||
browser = await extra.LaunchAsync(new LaunchOptions()
|
browser = await extra.LaunchAsync(new LaunchOptions()
|
||||||
{
|
{
|
||||||
Product = Product.Firefox,
|
Product = Product.Chrome,
|
||||||
Headless = false,
|
Headless = false,
|
||||||
Args = new[] { "--disable-web-security","--no-sandbox"}
|
Args = new[] { "--disable-web-security","--no-sandbox"}
|
||||||
});
|
});
|
||||||
@@ -58,12 +58,13 @@ namespace TestChrome
|
|||||||
|
|
||||||
//Stealth
|
//Stealth
|
||||||
Random rnd = new Random();
|
Random rnd = new Random();
|
||||||
string userAgent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 RuxitSynthetic/1.0 v7382549196557656907 t4157550440124640339";
|
//string userAgent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 RuxitSynthetic/1.0 v7382549196557656907 t4157550440124640339";
|
||||||
|
string userAgent = "RaceControl";
|
||||||
//await page.SetViewportAsync(new ViewPortOptions() { Width = rnd.Next(1000,2000), Height = rnd.Next(500,1500) });
|
//await page.SetViewportAsync(new ViewPortOptions() { Width = rnd.Next(1000,2000), Height = rnd.Next(500,1500) });
|
||||||
await page.SetJavaScriptEnabledAsync(true);
|
await page.SetJavaScriptEnabledAsync(true);
|
||||||
await page.SetUserAgentAsync(userAgent);
|
await page.SetUserAgentAsync(userAgent);
|
||||||
//await page.SetBypassCSPAsync(true);
|
await page.SetBypassCSPAsync(true);
|
||||||
//await page.SetExtraHttpHeadersAsync(new Dictionary<string, string>() { { "referer", "https://www.facebook.com/" } });
|
await page.SetExtraHttpHeadersAsync(new Dictionary<string, string>() { { "referer", "https://www.facebook.com/" } });
|
||||||
btnScreen.Enabled = true;
|
btnScreen.Enabled = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -128,8 +129,8 @@ namespace TestChrome
|
|||||||
*/
|
*/
|
||||||
//Keyboard k = new Keyboard(await page.Target.CreateCDPSessionAsync());
|
//Keyboard k = new Keyboard(await page.Target.CreateCDPSessionAsync());
|
||||||
|
|
||||||
|
|
||||||
await page.GoToAsync(url);
|
await page.GoToAsync(url);
|
||||||
|
//await page.WaitForNavigationAsync();
|
||||||
//Setting up the console tracking
|
//Setting up the console tracking
|
||||||
consoleLogs = "";
|
consoleLogs = "";
|
||||||
page.Console += trackConsole;
|
page.Console += trackConsole;
|
||||||
@@ -137,7 +138,8 @@ namespace TestChrome
|
|||||||
//To remove the cookie ask
|
//To remove the cookie ask
|
||||||
await TakeScreenshot("BeforeClick");
|
await TakeScreenshot("BeforeClick");
|
||||||
await page.Mouse.ClickAsync(630, 550);
|
await page.Mouse.ClickAsync(630, 550);
|
||||||
Thread.Sleep(2000);
|
await page.WaitForNavigationAsync();
|
||||||
|
Thread.Sleep(3000);
|
||||||
|
|
||||||
await TakeScreenshot("AfterClick");
|
await TakeScreenshot("AfterClick");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user