Selenium is a browser automation tool. This particular repository only covers Selenium setup for the C# programming language.
To continue further development with this tool, read the Selenium documentation for C#.
Unfortunately, Selenium itself doesn't support username:password
authentication for HTTP/HTTPs
proxies; therefore you will need to have your IP whitelisted.
You can do that by following the guidelines listed here.
To run these particular examples, use Visual Studio 19 to download WebDrivers and the Selenium package itself using C# NuGet:
If you are using something else, you'll need to download these packages separately:
You'll need at least one of the above drivers to continue with the next steps.
This particular code was built with Visual Studio with Visual Basic, which will be used to build and launch the application.
You can run it using these steps:
- Create a new Console Application.
- Navigate to the projects directory using the Terminal/Command Prompt.
- Run the cURL command to download the code or copy it directly from the repository by clicking on the preferred WebDriver hyperlink above.
curl https://raw.githubusercontent.com/Smartproxy/Selenium/master/csharp/firefox/example.cs > example.cs
curl https://raw.githubusercontent.com/Smartproxy/Selenium/master/csharp/chrome/example.cs > example.cs
- You should see a new file named example.cs in your project folder.
To configure the proxy, simply change the following string in the code depending on the WebDriver:
Firefox
HttpProxy = "gate.smartproxy.com:7000"
Chrome
HttpProxy = "http://gate.smartproxy.com:7000"
If everything is done correctly, the selected WebDriver will appear with a new IP from the proxy service after running the code. You'll also get a printed output of the IP in the Console:
Email - sales@smartproxy.com
Live chat 24/7