Skip to main content

A minimal python library that scrapes ssl proxies from https://sslproxies.org.

Project description

Description

free-ssl-proxies is a lightweight Python library that scrapes ssl proxies from https://sslproxies.org/, and provides some convenient objects and caching methods for working with the retrieved proxies. This library requires no external Python dependencies to work.

Usage

Installation

pip3 install .

Importing

from free_ssl_proxies import proxy_list as pl

First time retrieval

You can iterate through all the proxies currently available on sslproxies.org with the following code:

  • profile: If True, we will attempt to connect through each proxy
  • timeout: If the timeout is exceeded the proxy object will contain None for the avg_request_time (relatively slow proxy)
proxies = pl.ProxyList.from_ssl_proxies_org(profile=True, timeout=1)

for proxy in proxies:
    print(proxy.ip_address, proxy.port, proxy.cc, proxy.country, proxy.google, proxy.avg_request_time)

Caching

sslproxies.org refreshes their list every 10 minutes, so it doesn't make sense to constantly hammer their page with requests. This package offers a simple caching mechanism that can be used like so:

proxies = pl.ProxyList.from_ssl_proxies_org(profile=True, timeout=1)

pl.write_proxy_list_to_cache(proxies)

To access the cache later:

proxies = pl.ProxyList.from_cache()

Access

By country

You can use either the country name cc to find proxies.

for us_proxy in proxies.get_by_country("us"):
    print(us_proxy)

Fastest

You can get a sorted list of the fastest proxies if profiling has been done.

for fast_proxy in proxies.get_fastest():
    print(fast_proxy)

Random

You can get a random proxy selected from the fastest proxies if profiling has been done. If profiling has not been done then we will pick from the entire pool of available proxies.

proxy = proxies.random()

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

free-ssl-proxies-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

free_ssl_proxies-0.1.0-py2.py3-none-any.whl (5.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file free-ssl-proxies-0.1.0.tar.gz.

File metadata

  • Download URL: free-ssl-proxies-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for free-ssl-proxies-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d95d1e14037693f7bec0adbdbef65b4c8f2eda9730181ab8fb9352f1e04c2e01
MD5 605e525901dcd53985f20110cd6abb50
BLAKE2b-256 c9e5210cab1b340601aa148f400953222bc1c03fe7fa7372814c0816350e343a

See more details on using hashes here.

File details

Details for the file free_ssl_proxies-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for free_ssl_proxies-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 abbb58b155ef163922264ca8d7721e0ab40bcd75a47a35142befb83b8e73a577
MD5 96a6915fc09f243cbf02d9555b836dd7
BLAKE2b-256 79501463a988fa71d95273adfefa732ad4c39788eb22f609e963342e2d4dd972

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