A Python package to handle provide free proxies from sslproxies.org.
Project description
SSLProxies
Get free working proxy from https://www.sslproxies.org/ and use it in your script
This is a port/rewrite of free-proxy with additional features and validations.
SSLProxies pulls a list of free proxies from sslproxies.org
You can choose to select a random proxy, or select a specific proxy by a set of criteria.
SSLProxies also features a ProxyManager that can be used to cache and reuse proxies, including managing their working status.
Proxies are returned as objects with the following properties:
- ip: the IP address of the proxy
- port: the port of the proxy
- url: the full url of the proxy (this will always be HTTP regardless of the HTTPS status)
- country: the country of the proxy
- anonymity: the anonymity of the proxy
- https: whether the proxy supports https
- last_checked: the last time the proxy was checked
- last_working: the last time the proxy was working
- is_working: whether the proxy is working
- requests_dict: a pre-formatted dictionary object to be passed into a Requests library request
Requirements
- Python3
- Request library
- BeautifulSoup library
Installation
pip install sslproxies
Usage with examples
Get a random proxy:
from sslproxies import ProxyManager
proxy = ProxyManager().get_new_proxy()
or
from sslproxies import get_proxy
proxy = get_proxy()
Mark a proxy as working:
from sslproxies import ProxyManager
proxy = ProxyManager().get_new_proxy()
manager = ProxyManager()
manager.mark_proxy_as_working(proxy)
Options
from sslproxies import get_proxy
proxy = get_proxy(countries=['US'], anonymous=True)
countriesparameter
Get a proxy from a specified list of countries. If there is no countries specified, proxies from all countries will be considered. Defaultcountries=None.
proxy = get_proxy(countries=['US', 'BR', 'United States', 'Germany'])
verifyparameter
Return only a proxy that works (keeps testing proxies until one works). Defaultverify=False.
proxy = get_proxy(verify=True)
timeoutparameter
During verification, if test site doesn't respond in X number of seconds, the proxy is considered non-working. Defaulttimeout=0.5.
proxy = get_proxy(timeout=1)
randparameter
Pull a random proxy, rather than the first one on the list. Defaultrand=True.
proxy = get_proxy(rand=True)
anonymousparameter
Return only those proxies that are marked as anonymous. Defaultanonymous=False.
proxy = get_proxy(anonymous=True)
You can combine parameters:
proxy = get_proxy(country_id=['US', 'BR'], timeout=0.3, rand=True, verify=True)
If there is no proxy matching all criteria, get_proxy returns None.
These same options are available in get_new_proxy, get_non_working_proxy and get_cached_proxy via the ProxyManager.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sslproxies-0.1.0.tar.gz.
File metadata
- Download URL: sslproxies-0.1.0.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50bdc5b81bb3cbb17b857a895151adc72ae426eb83e1589914ecb6c43aa3561f
|
|
| MD5 |
26e1d2f897c5a3b4af96ad9e9284a923
|
|
| BLAKE2b-256 |
e6c78353e7c97917f8ee06a32b701e5e21c0836801f3226617c14a19f2ca337f
|
File details
Details for the file sslproxies-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sslproxies-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac2aafe66823da65bd7b28708ebdd35d3d710b561ea25593c5feaff7bd59052e
|
|
| MD5 |
9806822bf34353f16a89286b738e72d3
|
|
| BLAKE2b-256 |
85886599a1e35c0592077471598707b1d502a38c1bb0e97aca6de352ef12928e
|