proxy-randomizer
proxy randomizer
Free software: MIT license
Documentation: https://proxy-randomizer.readthedocs.io.
Description
Inpired by http-request-randomizer
proxy_randomizer is intended to use for small-meduim web scrapers/crawlers, helping to avoid temporal/permanent bans from web pages, generating random proxies to include in the requests
Installation
pip install proxy_randomizer
API
To use proxy_randomizer in your code, you just need to generate a RegisteredProviders instance and parse the providers.
from proxy_randomizer import RegisteredProviders
rp = RegisteredProviders()
rp.parse_providers()
print(f"proxy: {rp.get_random_proxy()}")
You can iterate throughout all proxies as simple as this.
from proxy_randomizer import RegisteredProviders
import requests
rp = RegisteredProviders()
rp.parse_providers()
for proxy in rp.proxies:
proxies = {"https": proxy.get_proxy()}
response = requests.get("http://google.com", proxies=proxies)
If you need to hide your identity, you can filter the proxy list by its anonymity level.
from proxy_randomizer import RegisteredProviders
from proxy_randomizer.proxy import Anonymity
rp = RegisteredProviders()
rp.parse_providers()
anonymous_proxies = list(
filter(lambda proxy: proxy.anonymity == Anonymity.ANONYMOUS, rp.proxies)
)
print(f"filtered proxies: {anonymous_proxies}")
There are four different anonymity levels, you can inspect them like this
from proxy_randomizer.utils import ANONYMITY_LEVELS
for level in ANONYMITY_LEVELS:
print(level.label)
Command-line interface
If you need some quick proxy, just type this in your terminal.
proxy_randomizer
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
1.3.5 (2023-01-03)
Move CI from Travis to GitHub Actions
Fix a bug in the project version bumps script
1.3.4 (2023-01-03)
Fix security issue
1.3.3 (2021-08-30)
Fix versions bumps
1.3.2 (2021-08-30)
Add python3.9 to travis cli
1.3.1 (2021-08-30)
Fix table not found error and some updates
Upate table selector and tests
Add python 3.9 compatibility in the config
1.3.0 (2021-01-06)
Bump lxml from 4.5.0 to 4.6.2
Change dev dependencies
1.2.1 (2020-12-23)
Fix dependencies versions
1.2.0 (2020-12-23)
Refactor code
0.1.0 (2020-08-02)
First release on PyPI.
Metadata
Release files for proxy-randomizer 1.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| proxy_randomizer-1.3.5.tar.gz | 40.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| proxy_randomizer-1.3.5-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 48.7 kB
Release files / proxy_randomizer-1.3.5.tar.gz
| Download URL | proxy_randomizer-1.3.5.tar.gz |
|---|---|
| Size | 40.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97f29864200f3aed39bf747e569516a55cf75d9fddd82283e3fc6349474a36b0
|
|
BLAKE2b-256 checksum How to use checksums |
cc103f699571fa090dad9ac66fdc956af49d42bdd164632047c57e092284672f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.9.2 requests/2.25.1 setuptools/59.6.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.10.6
|
Release files / proxy_randomizer-1.3.5-py2.py3-none-any.whl
| Download URL | proxy_randomizer-1.3.5-py2.py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
73d6b910b7dbdc84f158ee14e261455181b86d265dbbbb7f4f1fc5cff365a0bc
|
|
BLAKE2b-256 checksum How to use checksums |
a67a966cc613c994d88844e34b39d737ce7cf554e8a85be6ae730b9d52df673f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.9.2 requests/2.25.1 setuptools/59.6.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.10.6
|