私は情報をGoogleから取得するために使用します。私はいくつかの要求の後にブロックすることを知っています。そのためプロキシを通過しようとしました。プロキシのために私は、このリンクから ProxyBrokerを使用します。私はプロキシを使用している場合、私は、エラーをクリックすると The Linkpython - サービスを利用できません - urllibプロキシが動作しません
しかし、Googleは503を返し、GoogleはプロキシIPを私に私のIPを示していません。私はhttpとhttpsで試してみました
usedProxy = self.getProxy()
if usedProxy is not None:
proxies = {"http": "http://%s" % usedProxy[0]}
headers = {'User-agent': 'Mozilla/5.0'}
proxy_support = urlrequest.ProxyHandler(proxies)
opener = urlrequest.build_opener(proxy_support, urlrequest.HTTPHandler(debuglevel=1))
urlrequest.install_opener(opener)
req = urlrequest.Request(search_url, None, headers)
with contextlib.closing(urlrequest.urlopen(req)) as url:
htmltext = url.read()
:ここ
は、私が試したものです。
要求がうまくいっている場合であっても、私は次のメッセージこれで503取得:
send: b'GET http://www.google.co.in/search?q=Test/ HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: www.google.co.in\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n'
reply: 'HTTP/1.1 302 Found\r\n'
header: Date header: Server header: Location header: Pragma header: Expires header: Cache-Control header: Content-Type header: Content-Length header: X-XSS-Protection header: X-Frame-Options header:
>Connection send: b'GET http://ipv4.google.com/sorry/index?continue=http://www.google.co.in/search%3Fq%3DTest/&q=EgTCDs9XGMbOgNAFIhkA8aeDS0dE8uXKu31DEbfj5mCVdhpUO598MgFy HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: ipv4.google.com\r\nUser-Agent: Mozilla/5.0\r\n
>Connection: close\r\n\r\n'
reply: 'HTTP/1.1 503 Service Unavailable\r\n'
上記のエラーが発生していない場合、私は最終的に次のエラーを取得する:
>[Errno 54] Connection reset by peer
を
私の質問は以下のとおりです。
は私のIPとはないプロキシIPたびに、エラーのリンクからIPです?
そしてit's場合は、問題がエラーを回避する方法を、プロキシからであるホストIP何かグーグルからのエラーメッセージに示されており、たびに?