代理查询代码

import re
import requests
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.163 Safari/535.1',
}
proxies = {
  "http": "http://183.247.152.98:53281",
}
url='https://www.123cha.com/'
resp = requests.get(url,headers=headers,proxies=proxies)
print(re.findall('.+;您的ip:[[](.+)[]]',resp.text))

你可能感兴趣的:(代理查询代码)