LogoLogo
Nimble HomeLoginCreate an Account
  • Home
  • Quick Start Tutorials
    • Tutorial Library
      • Track SEO and SEM Ranking
      • Reddit as a Guerilla Marketing Strategy
  • Nimble Platform
    • Nimble Platform Overview
    • Online Pipelines
      • Supermarkets
        • ASDA
        • Tesco Groceries
        • Sainsbury’s
        • Morrisons
      • eCommerce
      • Restaurants
        • Yelp
        • Tabelog
        • Uber Eats Japan
        • Demaecan
        • Uber Eats US
      • Real Estate
        • Zillow
  • Nimble SDK
    • SDK Overview
    • Web API
      • Web API Overview
      • API Product Specs
      • Nimble Web API Quick Start Guide
        • Introduction
        • Nimble APIs Authentication
        • Real-time URL request
        • Delivery methods
        • Batch processing
        • Response codes
        • FAQs
      • Nimble Web API Functions
        • Realtime, Async & Batch Request
        • Geo Location Targeting
        • Javascript Rendering
        • Page Interaction
          • Wait (delay)
          • Wait for Selector
          • Wait and Click
          • Wait and Type
          • Scroll
          • Scroll to
          • Infinite Scrolling
          • Capturing Screenshots
          • Collecting Cookies
          • Executing HTTP Requests
          • Operation Reference
        • Network Capture
          • Filter by URL Matching
          • Filter By Resource Type
            • Real World Demo: Capturing Ajax Requests
          • Wait for Requests
          • Capturing XHR without Rendering
          • Operation Reference
        • Data Parsing
          • Parsing Templates
          • Merge Dynamic Parser
        • Custom Headers & Cookies
        • General Params
      • Vertical Endpoints
        • SERP API
          • Real-time search request
          • Getting local data
          • Browsing SERP pagination
          • Delivery methods
          • Batch Processing
          • Endpoints and Response Codes
        • Maps API
          • Searching for places
          • Getting information about a place
          • Collecting reviews
          • Delivery methods
          • Batch processing
          • Endpoints and Response Codes
    • Web Retrieval API
      • Web Retrieval API Overview
    • Proxy API
      • Nimble IP Overview
      • Nimble IP Quick Start Guide
        • Send a request
        • Nimble IP Autentication
        • Geotargeting and session control
        • Response codes
        • FAQs
      • Nimble IP Functions
        • Country/state/city geotargeting
        • Controlling IP rotation
        • Geo-sessions: longer, stickier, more accurate sessions
        • Using IPv6 Proxies
        • Response Codes
      • Integration Guides
        • Incogniton
        • Kameleo
        • VMLogin
        • AdsPower
        • FoxyProxy
        • Android
        • Multilogin
        • iOS
        • SwitchyOmega
        • Windows
        • macOS
        • Proxifier
        • MuLogin
        • Puppeteer
        • Selenium
        • Scrapy
    • Client Libraries
      • Installation
      • Quick Start
    • LangChain Integration
  • Technologies
    • Browserless Drivers
      • API Driver-Based Pricing
    • IP Optimization Models
    • AI Parsing Skills
  • Management Tools
    • Nimble Dashboard
      • Exploring the User Dashboard
      • Managing Pipelines
      • Reporting and Analytics
      • Account Settings
      • Experimenting with the Playground
      • Billing and history
    • Nimble Admin API
      • Admin API basics
      • Admin API reference
  • General
    • Onboarding Guide
      • Getting started with Nimble's User Dashboard
      • Nimble IP Basics
      • Nimble API Basics
      • Helpful Resources
    • FAQs
      • Account Settings and Security
      • Billing and Pricing
      • Tools and Integrations
      • Nimble API
      • Nimble IP
    • Deprecated APIs
      • E-commerce API
        • E-commerce API Authentication
        • Real-time product request
        • Real-time product search request
        • Delivery methods
        • Batch Processing
        • Endpoints and Response Codes
      • Unlocker Proxy Overview
        • Unlocker Proxy Quick Start Guide
          • Real-time request
          • FAQs
        • Unlocker Proxy FAQ
Powered by GitBook
On this page
  1. Nimble SDK
  2. Proxy API
  3. Integration Guides

Selenium

Selenium is a popular web browsing automation tool used in website testing and web scraping applications. In this guide, we'll walk you through the simple steps to connect Nimble IP with Selenium using Node.js.

This guide assumes you have already installed Selenium and Node.js on the relevant computer/server.

First, we install the proxy-chain extension which will help us authenticate Selenium requests to Nimble IP:

npm install selenium-webdriver proxy-chain

With proxy-chain installed, we can now build our main script:

const { Builder } = require('selenium-webdriver');
const proxyChain = require('proxy-chain');
const chrome = require('selenium-webdriver/chrome');

(async () => {
    const oldProxyUrl = 'http://account-accountName-pipeline-pipelineName:[email protected]:7000'; // Replace with your actual proxy credentials and URL
    const newProxyUrl = await proxyChain.anonymizeProxy(oldProxyUrl);

    const options = new chrome.Options();
    options.addArguments(`--proxy-server=${newProxyUrl}`);

    const driver = await new Builder()
        .forBrowser('chrome')
        .setChromeOptions(options)
        .build();

    try {
        await driver.get('https://example.com'); // Replace with your target URL
        console.log('Page loaded');
        
        // Add any actions you want to perform on the page here

    } finally {
        await driver.quit();
        await proxyChain.closeAnonymizedProxy(newProxyUrl, true);
    }
})();

Explanation:

  1. Anonymize the Proxy URL: proxyChain.anonymizeProxy(oldProxyUrl) is used to create a new anonymized proxy URL that encapsulates authentication details.

  2. Configure Selenium to Use the Proxy: The new proxy URL is added to Chrome’s launch options via the addArguments method. This instructs Selenium's Chrome WebDriver to route all requests through the anonymized proxy server.

  3. Clean Up: It’s important to properly close both the Selenium driver and the anonymized proxy server after your tests are complete to ensure no resources are left hanging.

This setup allows you to use Nimble IP with Selenium in a clean and efficient manner, handling authentication seamlessly and avoiding manual proxy configuration complexities.

PreviousPuppeteerNextScrapy