朦朦墨色染 2022-02-25 14:06 采纳率: 100%
浏览 1339
已结题

爬虫报错Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000002B5F5BC3C10>


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:

  • 写回答

1条回答 默认 最新

  • cab_bage 2022-02-25 21:01
    关注

    感觉是网址问题,所以报ConnectionError,这网址我浏览器上不去

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 3月6日
  • 已采纳回答 2月26日
  • 创建了问题 2月25日

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器