Using InsideProxy with Python (requests, Selenium, Scrapy)
Python is the most common language we see plugged into InsideProxy. Here's how to wire up credentials from Generate proxies into the three libraries people use most.
requests
import requests
proxy = "http://user-CC-us-s10:[email protected]:7001"
proxies = {"http": proxy, "https": proxy}
response = requests.get("https://example.com", proxies=proxies, timeout=15)
print(response.status_code)Selenium
Selenium doesn't support authenticated proxies natively through its standard capabilities, so the cleanest approach is a small proxy extension or a library like selenium-wire, which lets you set credentials directly:
from seleniumwire import webdriver
options = {
'proxy': {
'http': 'http://user-CC-us-s10:[email protected]:7001',
'https': 'http://user-CC-us-s10:[email protected]:7001',
}
}
driver = webdriver.Chrome(seleniumwire_options=options)
driver.get("https://example.com")Scrapy
Set the proxy per-request via the request meta, or globally with a downloader middleware. For a quick per-request setup:
yield scrapy.Request(
url,
meta={"proxy": "http://user-CC-us-s10:[email protected]:7001"},
)For production crawls, generate a batch of endpoints in Generate proxies and rotate through them in your middleware rather than hardcoding a single line — that way a single IP going stale never stalls the whole crawl.
Ready to put this to use?
Create a free account and generate your first proxy in minutes.