Python Proxy Utils
Project description
Python Proxy Utils
A set of python 3 utils to help with web scraping. Currently only a free proxy utility is implemented. It can be used as a proxy rotator or however you like.
Install
pip install python-proxy-utils
ProxyHelper Example Usage
When the class is initialised it scrapes a list of free proxies from a number of free proxy list websites concurrently using aiohttp.
>>> from proxy_utils import ProxyHelper
>>> p = ProxyHelper()
>>> p.get_count()
13224
>>> p.get_random()
'http://103.9.188.143:56368'
>>>
>>> import requests
>>> random_proxy = p.get_random()
>>> proxies = {'http': random_proxy, 'https': random_proxy}
>>> r = requests.get('http://example.com', proxies=proxies)
Free Proxy Lists Used
This class currently uses the below free lists. At the time of writing this these lists usually produced around 13,000 proxies.
- proxy-list.download
- free-proxy-list.net
Todo
- Testing
- Add ProxyHelper method that returns the proxies in the format requests wants it in
- Add more free proxy lists
- Add a clean method to the proxy helper to remove bad proxies
- Add a UserAgentHelper
Author
Jeremy Storer storerjeremy@gmail.com
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
File details
Details for the file python-proxy-utils-0.1.0.tar.gz.
File metadata
- Download URL: python-proxy-utils-0.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f77587be6edd6873a77990409dd6f1365fa1be29b5db377f167a6797c65b04d
|
|
| MD5 |
f429e50f0acdb944eecec8bed14ab9ab
|
|
| BLAKE2b-256 |
68971a25a4bf108bb0d25a4e07aed6bcf424b087371577158ac7945f7beb7561
|