Skip to main content

Scraper of free online proxies

Project description

getproxies

Get some free proxies scraped from free proxy sources.

from getproxies import get_proxies

proxies = get_proxies()
print(proxies[:10])
# [http://196.18.215.153:3128, https://36.67.89.179:65205, http://35.247.192.53:3128, socks5://113.54.158.40:1080, https://180.122.51.154:9999, socks4://117.44.28.152:9201, https://178.20.137.178:43980, https://109.86.121.118:46333, https://148.77.34.194:39175, socks4://114.99.16.195:1080]

or using cli:

$ poetry run getproxies --help
Usage: getproxies [OPTIONS]

  scrape free proxies from all sources and put it to STDOUT

Options:
  -p, --protocol [https|http|socks4|socks5]
                                  restrict to specific protocol
  -c, --country TEXT              only proxies from specified country (ISO
                                  double char code, e.g. US)

  -l, --limit INTEGER             limit proxy retrieval - increases
                                  performance

  -f, --format TEXT               proxy output format, available variables: ho
                                  st,port,protocol,code,country,anonymous,sour
                                  ce  [default: {protocol}://{host}:{port}]

  --help                          Show this message and exit.

Install

$ pip install getproxies
or for latest code
$ pip install -U git+https://github.com/granitosaurus/getproxies

Sources

Currently these sources are supported

source spider
http://free-proxy-list.net FreeProxyListSpider
http://proxy-daily.com ProxyDailySpider

extended usage

For more detailed proxy query a ProxyManager can be used:

from getproxies import ProxyManager

proxies = ProxyManager(
    limit=10,  # only 10 proxies
    protocol='socks5',  # only socks5 proxies
    country='us',  # only us proxies
)

limit parameter can reduce retrieval time

Proxy objects also have extended attributes:

class Proxy:
    host: str
    port: str
    protocol: str
    code: str = ''
    country: str = ''
    anonymous: bool = False
    source: str = ''

as strings they resolve to protocol://host:port template.

Project details


Download files

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

Source Distribution

getproxies-1.0.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

getproxies-1.0.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file getproxies-1.0.0.tar.gz.

File metadata

  • Download URL: getproxies-1.0.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.8.1 Linux/5.5.0-1-mainline

File hashes

Hashes for getproxies-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8b9e26ea774aa1ff2038f410a0c1acebe803484cc05eef77387a803468c32f27
MD5 1558bfcae566716302c0f39653c2f859
BLAKE2b-256 7223f717e851806d8aa8a527a06b53bd5d3ad9d84be5faffc5f635c598e33075

See more details on using hashes here.

File details

Details for the file getproxies-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: getproxies-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.8.1 Linux/5.5.0-1-mainline

File hashes

Hashes for getproxies-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1943706ea1c23bf64caef8f5ab611b919584b48e52ebb0d297a0570ac99b7ba0
MD5 8f32fe9bfea385e27843e8d6e386f2ea
BLAKE2b-256 5f269dc8d32c6f3a741d5ddfa4872360866ec28d9d29a33a08e7770a28c0b2a8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page