Skip to content

Instantly share code, notes, and snippets.

@JasonCrowe
Created September 11, 2019 01:25
Show Gist options
  • Save JasonCrowe/0eb50b42ae901892e90e686f0bd3c47a to your computer and use it in GitHub Desktop.
Save JasonCrowe/0eb50b42ae901892e90e686f0bd3c47a to your computer and use it in GitHub Desktop.
Selenium Proxy
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType
from time import sleep
lum_session = random.random()
zone = 'my_lum_zone'
lum_password = 'my_lum_password'
# Amazon.com will show my location
# my_proxy = f'{zone}{lum_session}:{lum_password}@zproxy.luminati.io:22225'
# Proxy I found on a public free proxy site.
# This proxy shows a location of 'Houston' on Amazon
# my_proxy = "207.191.15.166:38528"
prox = Proxy()
prox.proxy_type = ProxyType.MANUAL
prox.http_proxy = my_proxy
prox.ssl_proxy = my_proxy
capabilities = webdriver.DesiredCapabilities.CHROME
prox.add_to_capabilities(capabilities)
driver = webdriver.Chrome("./chromedriver", desired_capabilities=capabilities)
driver.get('http://www.amazon.com')
sleep(10)
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment