1
プロキシにアクセスしようとしています。これは、複数回pingしていて、オンラインで検索しています。Python:プロキシが動作しないことを要求します。
import requests
import re
s = requests.Session()
s.proxies = {'http': 'http://11.22.33.4455'}
r = s.get('https://www.iplocation.net/find-ip-address')
data = r.text
regex = r"1.2.3.45" # Proxy IP
regex2 = r"6.7.8.99" # My IP
matches = re.findall(regex, data)
matches2 = re.findall(regex2, data)
print(matches)
print(matches2) # Always prints out my current IP and not my proxy
これは私のコードです。私は正規表現を使ってhtmlコードでIPの言及を検索し、常に現在のIPだけを返します。私は自分のIPを教えてくれる別のウェブサイトを試してみました。私が間違っていることに対する示唆。
私は別のものにプロキシを変更HTTPSプロキシであるが、今、私はエラー 'requests.exceptions.ProxyErrorを取得していますOK:HTTPSConnectionPool' –
そして、プロキシが動作していることを確認してください: 'プロキシ= { 「HTTP」 : 'http://12.129.82.194:8080'、 'https': 'https://12.129.82.194:8080' } ' と' out = s.get(url、proxies = proxies) ' – Ben