Y
Y
yraiv2022-04-07 17:34:22
C++ / C#
yraiv, 2022-04-07 17:34:22

How to replace browser fingerprints with C# Selenium?

I need to change User agent, screen size, etc. etc.
I am making an application in visual studio.
Is this done in c#? 80% of everything that is googled is about python.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kuznetsov, 2022-04-14
@yraiv

> I need to change User agent, screen size, etc. etc.
User agent for google chrome:

var options = new ChromeOptions();
            options.AddArgument("--user-agent=New User Agent");
            var driver = new ChromeDriver(options);

For other drivers, the method may differ.
The screen size can be set using the following command:
driver.Manage().Window
                .Size = new System.Drawing.Size(width, height)

In general, settings and interaction with the window (browser) occurs through:
driver.Manage().Window

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question