Rotating Proxy
v0.1.6
회전 프록시를 효과적으로 관리하고 활용하기위한 파이썬 패키지. 이 모듈은 여러 프록시를 처리하는 간단하고 효율적인 방법을 제공하여 웹 스크래핑 또는 익명이 필요한 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 라이센스에 따라 라이센스가 부여됩니다. 자세한 내용은 라이센스 파일을 참조하십시오.