Skip to main content

Free Proxy Library for requests library

Project description

Vats_Proxy

Free Proxy library for Python to use with requests library. Checks proxy connection&health while scraping proxies.

Installation

pip install vats_proxy

Get started

How to initiate ProxyManager and Use it: Example usages are shown below

ProxyManager(count=4) #Gets 4 free proxy
ProxyManager(count=4, test_url="http://www.yourtargetsite.com") # Gets 4 proxy and test proxies by making requets to test_url

#####Get One Proxy

from vats_proxy import ProxyManager
import requests
# Initialize Manager
proxy_manager = ProxyManager(count=1, test_url="http://www.yourtargetsite.com") 
# Make request with proxy
proxy = proxy_manager.proxies.pop() # gets one proxy from proxy list
#proxy variable information:
	#type: dict
	#value example: {"http": "http://192.68.1.1:9954"}
request = requests.get("https://www.google.com", proxies=proxy)

#####Get Multiple Proxies and Make Each request with different proxy

from vats_proxy import ProxyManager
import requests
# Initialize Manager
proxy_manager = ProxyManager(count=5, test_url="http://www.yourtargetsite.com")
# Make request with proxy
for proxy in proxy_manager.proxies:
	request = requests.get("https://www.google.com", proxies=proxy)

#####Handle Failed Proxy Connection

from vats_proxy import ProxyManager
import requests
from requests.exceptions import ProxyError
# Initialize Manager
proxy_manager = ProxyManager(count=1)
proxy = proxy_manager.proxies.pop()
try:
	request = requests.get("https://www.google.com", proxies=proxy)
except ProxyError:
	proxy = proxy_manager.request_proxy() # returns new proxy

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

vats_proxy-0.5.1.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file vats_proxy-0.5.1.tar.gz.

File metadata

  • Download URL: vats_proxy-0.5.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5

File hashes

Hashes for vats_proxy-0.5.1.tar.gz
Algorithm Hash digest
SHA256 7f346a811bf0460af539fae5b4948cbf05de0dadf68b394ed4b65498b900b501
MD5 dc55d45137dfcfe7ea70a5864b54a1dd
BLAKE2b-256 b6fb7114149effe9c7719c10a6d2ce10cfbf70f2957bae427536ed1d5168ce71

See more details on using hashes here.

Supported by

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