Selenium is a browser automation tool. This repository only covers Selenium setup for the Node.js (Javascript) programming language.
To continue further development with this tool, make sure to read the official Selenium documentation.
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 to install at least one of the above WebDrivers in the Installation part.
- Once you have all the required prerequisites ready, create your project folder:
mkdir node_selenium
cd node_selenium
npm init
npm install selenium-webdriver
- When the project directory is set up, you'll need to install one of the WebDrivers from the Prerequisites section.
Firefox
Chrome
- Download the example script according to the WebDriver you are using with one of these commands:
Firefox
curl https://raw.githubusercontent.com/Smartproxy/Selenium/master/nodejs/firefox/example.js > example.js
Chrome
curl https://raw.githubusercontent.com/Smartproxy/Selenium/master/nodejs/chrome/example.js > example.js
- Your project folder should now be populated with the example.js file.
To configure the example script with a different endpoint, simply edit the let addr =
line in within punctuation marks('') as in the example:
You can test the script by running the node example.js
command while in your project folder.
A browser window will appear with the targeted website, and a proxy IP should be visible in the console output:
Email - sales@smartproxy.com
Live chat 24/7