Selenium is a browser automation tool. This particular repository only covers Selenium setup using the Java programming language.
To continue further development with this tool, read Selenium's official documentation for Java.
Unfortunately, Selenium itself doesn't support username:password
authentication for HTTP/HTTPs
proxies; therefore, you'll need to have your IP whitelisted.
You can do that by following the guidelines listed here.
Optional:
You'll need at least one of the above drivers to continue with the next steps.
This code was built with Eclipse, which will be used to build and launch the application.
If you feel like using something else or executing the script with the javac
command, you may need to install JAVA JRE.
Once you have all of the prerequisites ready, create your project folder:
mkdir your_project
When the project directory is set up, you can now download our example script for Selenium.
Make sure that you download the script according to which WebDriver you want to use:
- Open the Terminal/Command Prompt window.
- Navigate to the main directory of your project folder using
cd your_project
- Download one of the examples below.
- You should now see your project folder populated with the example.java file.
Firefox
curl https://raw.githubusercontent.com/Smartproxy/Selenium/master/java/firefox/example.java > example.java
Chrome
curl https://raw.githubusercontent.com/Smartproxy/Selenium/master/java/chrome/example.java > example.java
To configure the proxy, simply change the following strings in the code:
String ProxyServer = "gate.smartproxy.com"; # Location you want to target
int ProxyPort = 7000; # Port for session
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 - [email protected]
Live chat 24/7