Skip to content

Python proxy helper. Please use deligently and respectfully! Always respect a websites ROBOTS.txt!

License

Notifications You must be signed in to change notification settings

HOWZ1T/py_proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

py_proxy

Python proxy manager.
Please use diligently and respectfully.
Always respect a website's ROBOTS.txt

compatibility

This library is compatible with python 3

dependencies

This library is dependant on:

  • requests
  • beautifulsoup4

install

pip install py_proxy

Features

  • Automatically fetches up to 80 proxies
  • Cycle between proxies easily
  • Test a proxy and get details about the proxy
  • Validate all fetched proxies concurrently
  • Format proxies for use with requests library

Examples

from proxy import Proxy

proxy = Proxy()

# getting the current proxy
cur_proxy = proxy.proxy

# testing the current proxy
res = proxy.test_proxy(cur_proxy)

if res == 1:
	print("success!")
else:
	print("failure!")
	
# cycling the proxy to a new proxy from the pool
proxy.cycle()

# filtering proxies by a country code
proxy = Proxy("US") #gets US only proxies from the pool

# automatically validating proxies after fetching them
proxy = Proxy(validate_proxies=True)

# format a proxy for use with requests library
ip = "100.100.100.100" #example ip, not real
port = "1989" #example port, not real
addr = [ip, port]
proxies = proxy.format_proxy(addr) #returns the requests proxies dictionary

# validating all proxies concurrently
proxy.validate_proxies()

# cycling through valid only proxies
proxy.cycle(valid_only=True)

License

You're free to use this package which is licensed under the MIT-LICENSE

Contributing

Contribution is always appreciated.
If you are contributing please remember to update the README.
If your contribution is accepted you will be credited for it.

Original Author

Dylan Randall aka HOWZ1T

Contributors

Berkkarahan - added multi-thread proxy validation

About

Python proxy helper. Please use deligently and respectfully! Always respect a websites ROBOTS.txt!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages