import json
import requests
header = {"user-agent":"Mozilla/5.0.html (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.html.2171.71 Safari/537.36",
"Connection":"close"}
proxy = {'http': '33.33.33.10:8118'}
qcc = requests.get(
"https://api/bigsearch/zhuanliList?isAgg=true&kindcode=B&pageIndex=1&pageSize=20&publicationyear=2021&searchKey=%E7%BA%BA%E7%BB%87&status=0101",
headers=header,
proxies=proxy,
).text
data = json.loads(qcc)
patent = data['Result']
for n in patent:
key=n['KeyNo']
print(key)
报错如下:
Exception has occurred: ConnectionError
HTTPSConnectionPool(host='api', port=443): Max retries exceeded with url: /bigsearch/zhuanliList?isAgg=true&kindcode=B&pageIndex=1&pageSize=20&publicationyear=2021&searchKey=%E7%BA%BA%E7%BB%87&status=0101 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000002B5F5BC3C10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred: