Skip to content
Beginner / 5 min read

How to Use ProxyScrape Proxies with Selenium on Linux for Web Scraping (Beginner's Guide)

A beginner-friendly, step-by-step guide to configuring ProxyScrape residential, datacenter, or mobile proxies in Selenium on Linux. Includes HTTP and SOCKS5 setup, authentication workarounds, and basic rotation for web scraping.

Linux SOCKS5 HTTP(S) Web Scraping

Overview

If you've been searching for "proxy scape," "proxyscaper," or "proxyscape," you're likely looking for ProxyScrape. This guide uses the correct spelling. ProxyScrape provides residential, datacenter, and mobile proxies with HTTP and SOCKS5 support, a pool of 97M+ IPs, and both pay-as-you-go and flat monthly billing.

In this beginner's tutorial, you'll set up ProxyScrape proxies in Selenium on Linux to scrape web pages. We'll cover HTTP and SOCKS5, authentication, and basic rotation. By the end, you'll have a working Selenium script that routes traffic through a ProxyScrape proxy.

Prerequisites

  • A ProxyScrape account (free trial or paid plan).
  • Linux system (tested on Ubuntu/Debian).
  • Python 3.6 or higher.
  • pip package manager.
  • Google Chrome or Firefox installed.
  • Basic terminal familiarity.

Steps

  1. Get your ProxyScrape proxy credentials.

    Log in to your ProxyScrape dashboard and navigate to the proxy type you want to use (residential, datacenter, or mobile). Note the following:

    • Endpoint: host:port
    • Username and password (if authentication is enabled)

    For web scraping, residential proxies are often the most reliable for avoiding blocks, while datacenter proxies are faster and cheaper.

  2. Install Selenium and WebDriver on Linux.

    Install the Selenium Python package:

    pip install selenium
    

    Install ChromeDriver (for Chrome/Chromium):

    sudo apt update
    sudo apt install chromium-chromedriver
    

    Or install GeckoDriver (for Firefox):

    sudo apt install firefox-geckodriver
    

    Ensure the driver is in your PATH. You can check with which chromedriver.

  3. Write a basic Selenium script with a ProxyScrape HTTP proxy.

    Create a file named selenium_proxy.py and add the following code. Replace the placeholders with your ProxyScrape credentials.

    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    
    PROXY = "http://username:password@host:port"  # e.g., http://user123:[email protected]:8080
    chrome_options = Options()
    chrome_options.add_argument(f'--proxy-server={PROXY}')
    driver = webdriver.Chrome(options=chrome_options)
    driver.get("https://httpbin.org/ip")
    print(driver.page_source)
    driver.quit()
    

    Run the script:

    python selenium_proxy.py
    

    You should see a JSON response containing an IP address different from your own. If it shows your real IP, the proxy is not working correctly.

  4. Handle proxy authentication for HTTP proxies.

    Chrome's --proxy-server flag does not support inline username/password for HTTP proxies. The easiest solution for beginners is to whitelist your IP in the ProxyScrape dashboard. Go to your proxy settings and add your current public IP to the whitelist, then remove the username/password from the proxy URL.

    Alternatively, use the selenium-wire library which supports authenticated proxies:

    pip install selenium-wire
    
    from seleniumwire import webdriver
    
    options = {
        'proxy': {
            'http': 'http://username:password@host:port',
            'https': 'https://username:password@host:port',
        }
    }
    driver = webdriver.Chrome(seleniumwire_options=options)
    driver.get("https://httpbin.org/ip")
    print(driver.page_source)
    driver.quit()
    
  5. Use SOCKS5 proxies with Selenium.

    ProxyScrape also supports SOCKS5. Chrome can use SOCKS5 with authentication inline:

    PROXY = "socks5://username:password@host:port"
    chrome_options.add_argument(f'--proxy-server={PROXY}')
    

    Note that Firefox may require additional configuration for SOCKS5 authentication.

  6. Add basic proxy rotation.

    For simple rotation, maintain a list of proxies and randomly select one for each browser session. ProxyScrape's residential proxies often provide a rotating endpoint, but you can also rotate manually.

    import random
    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    
    proxies = [
        "http://user:pass@host1:port",
        "http://user:pass@host2:port",
        # Add more proxies from your ProxyScrape list
    ]
    
    proxy = random.choice(proxies)
    chrome_options = Options()
    chrome_options.add_argument(f'--proxy-server={proxy}')
    driver = webdriver.Chrome(options=chrome_options)
    driver.get("https://httpbin.org/ip")
    print(driver.page_source)
    driver.quit()
    

    For production scraping, consider using a proxy rotation service or a library like selenium-wire with custom middleware.

  7. Test your scraping script.

    Write a simple scraper to fetch a page and extract the title:

    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    from selenium.webdriver.common.by import By
    
    PROXY = "http://username:password@host:port"
    chrome_options = Options()
    chrome_options.add_argument(f'--proxy-server={PROXY}')
    driver = webdriver.Chrome(options=chrome_options)
    driver.get("https://example.com")
    print(driver.title)
    driver.quit()
    

    If you see the page title, your proxy is working.

Troubleshooting

  • chromedriver not found: Ensure the driver is installed and in your PATH. Use export PATH=$PATH:/path/to/driver if needed.
  • Proxy connection refused: Verify your credentials, endpoint, and IP whitelist. Check that your ProxyScrape plan is active.
  • Authentication popup in Chrome: Use IP whitelisting or selenium-wire to avoid the popup.
  • Slow speeds: Try datacenter proxies for faster responses, or reduce the number of concurrent sessions.
  • SSL certificate errors: Add --ignore-certificate-errors to Chrome options for testing (not recommended for production).

Summary

You've learned how to use ProxyScrape proxies with Selenium on Linux for web scraping. We covered obtaining credentials, installing Selenium, setting HTTP and SOCKS5 proxies, handling authentication, and basic rotation. Remember to respect website terms of service and robots.txt. For more advanced setups, explore ProxyScrape's rotating endpoints and session control features.