integración

< Volver a la Integración

Integración de Luminati con Selenium

Luminati Super Proxy and Selenium Integration

  • Begin by going to your Luminati Dashboard and clicking ‘create a zone’.
  • Choose 'Network type' and click save.
  • Within Selenium fill in the ‘Proxy IP:Port’ in the 'setProxy' function for examplezproxy.lum-superproxy.io:22225 of both http and https.
  • Under ‘sendKeys’ input your Luminati account ID and proxy zone name:lum-customer-CUSTOMER-zone-YOURZONE and your zone password found in the zone settings.
  • For example:

const {Builder, By, Key, until} = require('selenium-webdriver');
const proxy = require('selenium-webdriver/proxy');

(async function example(){
  let driver = await new Builder().forBrowser('firefox').setProxy(proxy.manual({
    http: 'zproxy.lum-superproxy.io:22225',
    https: 'zproxy.lum-superproxy.io:22225'
  })).build()

  try {
    await driver.get('http://lumtest.com/myip.json');
    driver.switchTo().alert()
      .sendKeys('lum-customer-USERNAME-zone-YOURZONE'+Key.TAB+'PASSWORD');
    driver.switchTo().alert().accept();
  } finally {
      await driver.quit();
  }
})();

Luminati Proxy Manager and Selenium Integration

  • Create a zone with the network, IP type and number of IPs you wish to use.
  • Install the Luminati Proxy Manager.
  • Click ‘add new proxy’ and choose the zone and settings you require, click ‘save’.
  • In Selenium under the setProxy input your local IP and proxy manager port (i.e. 127.0.0.1:24000)
    • The local host IP is 127.0.0.1
    • The port created in the Luminati Proxy Manager is 24XXX, for example 24000
  • Leave the username and password field empty, as the Luminati Proxy Manager has already been authenticated with the Super Proxy.
  • For example:
const {Builder, By, Key, until} = require('selenium-webdriver');
const proxy = require('selenium-webdriver/proxy');

(async function example(){
    let driver = await new Builder().forBrowser('firefox').setProxy(proxy.manual({
        http: '127.0.0.1:24000',
        https: '127.0.0.1:24000'
    })).build()

    try {
        await driver.get('http://lumtest.com/myip.json');
        driver.switchTo().alert().accept();
    } finally {
        await driver.quit();
    }
})();