import requests
HEADERS = {
\'User-Agent\': \'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\'}
targetUrl = \'https://bj.lianjia.com/xiaoqu/1111027378998/\'
#代理服务器
proxyHost = "proxy.abuyun.com"
proxyPort = "9020"
# 代理隧道验证信息
proxyUser = "HB152X168056Q14D"
proxyPass = "26789783FA384856"
proxyMeta = "http://%(user)s:%(pass)s@%(host)s:%(port)s" % {"host": proxyHost, "port": proxyPort, "user": proxyUser,
"pass": proxyPass, }
proxies = {"http": proxyMeta, "https": proxyMeta, }
if __name__ == \'__main__\':
print(proxies)
res = requests.get(targetUrl, headers=HEADERS, proxies=proxies).text
print(res)
# print(proxies)