const { Builder } = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');
const proxyChain = require('proxy-chain');
(async () => {
// Replace with your Nimble pipeline credentials
const proxyUrl = 'http://YOUR_USERNAME:[email protected]:7000';
// Anonymize the proxy URL (handles authentication)
const anonymizedProxy = await proxyChain.anonymizeProxy(proxyUrl);
// Configure Chrome options with proxy
const options = new chrome.Options();
options.addArguments(`--proxy-server=${anonymizedProxy}`);
options.addArguments('--no-sandbox');
options.addArguments('--disable-setuid-sandbox');
// Build the WebDriver
const driver = await new Builder()
.forBrowser('chrome')
.setChromeOptions(options)
.build();
try {
// Navigate to your target URL
await driver.get('https://example.com');
// Get page title
const title = await driver.getTitle();
console.log('Page title:', title);
// Your automation logic here...
} finally {
// Clean up
await driver.quit();
await proxyChain.closeAnonymizedProxy(anonymizedProxy, true);
}
})();