问题遇到的现象和发生背景
没有返回的吗?还是我代码问题
问题相关代码,请勿粘贴截图
import requests
headers = {
'content-type': 'text/html; charset=GBK',
'upgrade-insecure-requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 '
'Safari/537.36 SE 2.X MetaSr 1.0'
}
proxy = 'cmproxy.gmcc.net:8081'
proxies = {
'http': 'http://'+proxy,
'https': 'http://'+proxy,
}
def query_term(name):
url = "https://detail.zol.com.cn/index.php?c=SearchList&keyword="+name
print(url)
requests.packages.urllib3.disable_warnings()
respon = requests.get(url=url, verify=False, headers=headers, proxies=proxies)
response_term(respon)
def response_term(re):
data = re.text
print(data)
if __name__ == '__main__':
# https://detail.zol.com.cn/index.php?c=SearchList&kword=RIO-UL00
query_term("RIO-UL00")
运行结果及报错内容
D:\Python38\python.exe D:/DATA/Desktop/Python自动化/手机型号和代码对照.py
https://detail.zol.com.cn/index.php?c=SearchList&kword=RIO-UL00
Process finished with exit code 0
我的解答思路和尝试过的方法
没有内容的