2018년 12월 5일 Python 457 comments Python, 파이썬
파이썬에서 Proxy를 명시한 상태로 HTTP Request하는 예제를 찾아본 뒤 정리해둔다.
import requests from requests.auth import HTTPProxyAuth proxyDict = { 'http' : '77.75.105.165', 'https' : '77.75.105.165' } auth = HTTPProxyAuth('username', 'mypassword') r = requests.get("http://www.google.com", proxies=proxyDict, auth=auth)