Rotating Proxy
v0.1.6
แพ็คเกจ Python สำหรับการจัดการและใช้พร็อกซีหมุนได้อย่างมีประสิทธิภาพ โมดูลนี้ให้วิธีที่ง่ายและมีประสิทธิภาพในการจัดการพร็อกซีหลายตัวสลับระหว่างพวกเขาโดยอัตโนมัติเพื่อปรับปรุงการขูดเว็บหรือคำขอ HTTP ใด ๆ ที่ต้องไม่เปิดเผยตัว
คุณสามารถติดตั้งแพ็คเกจโดยใช้ PIP:
pip install rotating-proxy from rotating_proxy import ProxyPool , ProxySession
class Project :
def __init__ ( self ):
# Initialize the proxy pool with a list of proxies.
# Replace "127.0.0.1:80" with your own proxies in the format:
# ["http://proxy1","http://proxy2",..."http://proxyN"]
self . proxy_pool = ProxyPool ([ "http://127.0.0.1:80" ])
self . proxy_pool . filter_working_proxies ()
self . proxy_session = ProxySession ( self . proxy_pool )
def request_function ( self , ** kwargs ):
try :
response = self . proxy_session . request ( ** kwargs )
print ( f"IP Address: { response . json ()[ 'origin' ] } " )
except Exception as e :
print ( f"An error occurred: { str ( e ) } " )
if __name__ == "__main__" :
project = Project ()
project . request_function ( url = "https://httpbin.org/ip" , method = "GET" )ยินดีต้อนรับ! หากคุณมีคำแนะนำสำหรับการปรับปรุงหรือคุณสมบัติเพิ่มเติมอย่าลังเลที่จะเปิดปัญหาหรือส่งคำขอดึง
โครงการนี้ได้รับใบอนุญาตภายใต้ใบอนุญาต MIT ดูไฟล์ใบอนุญาตสำหรับรายละเอียด