{"id":8183,"library":"free-proxy","title":"Free Proxy Scraper","description":"The `free-proxy` library (version 1.1.3) is a Python package designed to scrape, verify, and provide free working proxies from various online sources such as sslproxies.org, us-proxy.org, and free-proxy-list.net. It allows users to filter proxies by country, anonymity, HTTPS support, and define custom timeouts, making it useful for web scraping with libraries like `requests` or `Selenium`. The library is actively maintained with regular updates.","status":"active","version":"1.1.3","language":"en","source_language":"en","source_url":"https://github.com/jundymek/free-proxy","tags":["proxy","scraper","web scraping","anonymity","network"],"install":[{"cmd":"pip install free-proxy","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Used for making HTTP requests to verify proxies and target websites.","package":"requests","optional":false},{"reason":"Used for parsing HTML content from proxy list websites to extract proxy information.","package":"lxml","optional":false},{"reason":"Requires Python 3.6 or higher for execution.","package":"python","optional":false}],"imports":[{"symbol":"FreeProxy","correct":"from fp.fp import FreeProxy"}],"quickstart":{"code":"from fp.fp import FreeProxy\nimport requests\nimport os\n\n# Get a random working proxy\nproxy = FreeProxy(rand=True, timeout=1).get()\n\nif proxy:\n    print(f\"Found working proxy: {proxy}\")\n    proxies = {\n        \"http\": proxy,\n        \"https\": proxy,\n    }\n    try:\n        # Test the proxy with a simple request\n        # Use a reliable target URL, e.g., ipify.org to check the proxy IP\n        response = requests.get('https://api.ipify.org?format=json', proxies=proxies, timeout=5)\n        if response.status_code == 200:\n            print(f\"Request through proxy successful. Your IP via proxy: {response.json()['ip']}\")\n        else:\n            print(f\"Request through proxy failed with status: {response.status_code}\")\n    except requests.exceptions.RequestException as e:\n        print(f\"Error making request through proxy: {e}\")\nelse:\n    print(\"No working proxies found at this time.\")\n\n# Example with specific country and HTTPS\n# Note: Free proxies can be unreliable and may not always work as expected.\n# You might need to run this multiple times or adjust parameters.\nprint(\"\\nTrying to get an HTTPS proxy from US or BR...\")\nus_br_proxy = FreeProxy(country_id=['US', 'BR'], https=True, timeout=2, rand=True).get()\nif us_br_proxy:\n    print(f\"Found US/BR HTTPS proxy: {us_br_proxy}\")\nelse:\n    print(\"No working US/BR HTTPS proxies found.\")","lang":"python","description":"Initializes `FreeProxy` to get a working proxy. The first example fetches a random proxy and tests it with `requests`. The second example demonstrates fetching an HTTPS proxy specifically from the US or Brazil. Due to the nature of free proxies, reliability can vary, and retries may be necessary."},"warnings":[{"fix":"Update your code to catch `fp.fp.FreeProxyException` instead of relying on `SystemExit` or uncontrolled program termination. Example: `try: ... except FreeProxyException as e: print(e)`.","message":"In version 1.0.5, the library changed its error handling mechanism from calling `sys.exit()` to raising a `FreeProxyException`.","severity":"breaking","affected_versions":"<1.0.5"},{"fix":"Implement robust error handling, retry mechanisms, and consider using a pool of proxies. For critical applications, paid proxy services offer greater reliability and performance.","message":"Free proxies are inherently unreliable, often slow, short-lived, or quickly blacklisted. This can lead to frequent connection errors, timeouts, or HTTP status codes like 403 Forbidden or 429 Too Many Requests from target websites.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update the `free-proxy` library to ensure compatibility with upstream proxy source websites. If you encounter issues, check the library's GitHub for recent updates or reported issues.","message":"Website structure changes on proxy source sites (e.g., sslproxies.org) can break the scraping logic (XPath selectors), leading to no proxies being found. This happened in version 1.0.3.","severity":"gotcha","affected_versions":"<1.0.3"},{"fix":"Ensure you are using `free-proxy` version 1.1.1 or newer for reliable HTTPS proxy filtering.","message":"Older versions (prior to 1.1.1) may have had issues with the `https` parameter, potentially failing to correctly filter or provide HTTPS proxies.","severity":"gotcha","affected_versions":"<1.1.1"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Relax your filtering criteria (e.g., remove `country_id`, `https=True`, or increase `timeout`). Try running the script again, as proxy lists update frequently. Consider implementing retry logic with a delay.","cause":"The library could not find any active proxies from its sources that meet the specified criteria (country, anonymity, HTTPS, timeout) after checking. Free proxies are often down or blocked.","error":"fp.fp.FreeProxyException: There are no working proxies at this time."},{"fix":"Update `free-proxy` to version 1.0.1 or higher to resolve this specific parsing issue. Ensure that the proxy string received is correctly formatted before passing it to `requests` or other HTTP clients.","cause":"This error, fixed in version 1.0.1, indicates an issue where the library might return a proxy without a proper scheme (e.g., 'http://' or 'https://') or where `urllib3` fails to parse the proxy string.","error":"urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme None"},{"fix":"Retry with a different proxy. If using custom proxies, ensure credentials are correct. For `free-proxy`, this often means the chosen proxy is dead or blocked; try getting another one via `FreeProxy().get()`.","cause":"The proxy server rejected the connection (e.g., 403 Forbidden, 407 Proxy Authentication Required) or failed to tunnel the request to the target website. This is common with unreliable free proxies or if the proxy requires authentication not supported by `free-proxy`.","error":"requests.exceptions.ProxyError: ('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))"},{"fix":"Implement robust retry logic (e.g., using `requests` with `urllib3.Retry`). Increase the `timeout` parameter in `FreeProxy()` and your `requests.get()` call. Fetch a new proxy if errors persist.","cause":"The connection was abruptly terminated by either the proxy server or the target server. This can happen due to proxy instability, timeouts, or the target website detecting and blocking the proxy.","error":"requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))"}]}