Skip to main content

title: Title

summary: "summary"

Proxy Manager - Python

The package is intended to manage a set of proxies, rotating through at random, to prevent blocking. Proxies are currently dropped from the rotation if they fail twice in a row.

VERY EARLY STAGE

Installation

pip install ProxyManager

Basic usage

PROXY_LIST = [
         '70.45.80.236:4602',
         '70.45.80.236:4603',
         '70.45.80.236:4604'
        ]

URL = 'http://www.myurl.com'

from ProxyManager.core import ProxyManager, Proxy

proxies = [i for i in PROXY_LIST] # OR [Proxy(i) for i in PROXY_LIST]
PM = ProxyManager(proxies)
result = PM.make_request(URL)

# Pass a fail function into make_request method, to check for domain/website specific indicators that the request has failed
# i.e. tell the ProxyManager, that this request has failed
def fail_function(response):
    if '<something_wrong_about>' in response:
        return True
    return False

result = PM.make_request(URL, fail_func=fail_function) # or PM.fail_func = fail_function

Free Proxies

If you don't bring your own proxies, which is HIGHLY recommended, I have written a function that scrapes https://free-proxy-list.net/ to obtain a set of proxies.

from ProxyManager.free_proxies import get_free
FREE_PROXIES = get_free(10)
proxies = [Proxy('{}:{}'.format(i['ip'], i['port'])) for i in FREE_PROXIES]

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ProxyManager-0.0.6.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ProxyManager-0.0.6-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file ProxyManager-0.0.6.tar.gz.

File metadata

  • Download URL: ProxyManager-0.0.6.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for ProxyManager-0.0.6.tar.gz
Algorithm Hash digest
SHA256 ec21af74ca6ba7e085e7572b88cd638bb8be782a99e9c10ec8664344f94c552d
MD5 0a80e976f103024d98349c6347d20f74
BLAKE2b-256 4a16154be2f9ff4a380c9641611077975d8c998bfba19c66eae76e5bf4838682

See more details on using hashes here.

File details

Details for the file ProxyManager-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: ProxyManager-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for ProxyManager-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c7a92926cb10645187a5783ac6528b28f03334ba34879d76c32b3b776599172e
MD5 39324662d1daf108179c35a0cb650578
BLAKE2b-256 002105d9074db71227f8ce5c1bf6d226974140b01552a5929026de32d907f93c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page