首页 > 其他分享 >requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b&

requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b&

时间:2023-02-01 10:12:48浏览次数:48  
标签:code read tool py bytes length File line spiderYesmro3

Traceback (most recent call last):
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\urllib3\response.py", line 761, in _update_chunk_length
    self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\urllib3\response.py", line 444, in _error_catcher
    yield
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\urllib3\response.py", line 828, in read_chunked
    self._update_chunk_length()
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\urllib3\response.py", line 765, in _update_chunk_length
    raise InvalidChunkLength(self, line)
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\requests\models.py", line 816, in generate
    yield from self.raw.stream(chunk_size, decode_content=True)
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\urllib3\response.py", line 624, in stream
    for line in self.read_chunked(amt, decode_content=decode_content):
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\urllib3\response.py", line 816, in read_chunked
    with self._error_catcher():
  File "D:\code_tool\python\lib\contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\urllib3\response.py", line 461, in _error_catcher
    raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\code_tool\spiderYesmro3\main.py", line 253, in <module>
    main()
  File "D:\code_tool\spiderYesmro3\main.py", line 30, in main
    for cate, lists in get_data():
  File "D:\code_tool\spiderYesmro3\main.py", line 99, in get_data
    resp = requests.get(detail_cate_url, headers=headers)
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\requests\sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\requests\sessions.py", line 745, in send
    r.content
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\requests\models.py", line 899, in content
    self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
  File "D:\code_tool\spiderYesmro3\venv\lib\site-packages\requests\models.py", line 818, in generate
    raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))

Process finished with exit code 1

标签:code,read,tool,py,bytes,length,File,line,spiderYesmro3
From: https://www.cnblogs.com/czzz/p/17081646.html

相关文章

  • .net升级7.0报错1. MySqlConnection is already in use. See https://fl.vu/mysql-con
    框架升级到7.0后,经常出现服务崩溃的问题,频繁到几乎五分钟一次...然后开始盯日志,得到以下下几种异常:MySqlConnectionisalreadyinuse.Seehttps://fl.......
  • re.findall() 报错:TypeError: expected string or bytes-like object
    复现:解决:importrepattern_str='共(.*?)件商品'result=re.findall(pattern_str,str(b'fsdf'))总结:findall,第二个参数只能是字符串......
  • Java并发——ThreadLocal详解
    引言ThreadLocal的官方API解释为:“该类提供了线程局部(thread-local)变量。这些变量不同于它们的普通对应物,因为访问某个变量(通过其get或set方法)的每个线程都有自己......
  • readlink命令
    readlink命令作用:输出符号链接的链接值或文件的权威文件名,通俗说:输出符号链接的链接值、文件的全路径。常用的参数:-f,递归跟随给出文件名的所有符号链接以标准化,除最后一......
  • 上传文件报错:The field files exceeds its maximum permitted size of 1048576 bytes
    SpringBootconfiguresSpringMVCwithamaximumfileof1Mbperfileandamaximumof10Mboffiledatainasinglerequest文件上传有默认最大限制,即最大可支持......
  • 如何获取input框type=file选中的文件对象(FileReader)
    最近突发奇想想做一个现在常用的图像上传然后从中截取头像保存的案例,所以做了一些准备工作,比如input框选择文件触发的哪些事件,这一节就保存一下我们如何获取input的type=fil......
  • 12.ThreadLocal的那点小秘密
    大家好,我是王有志。关注王有志,一起聊技术,聊游戏,聊在外漂泊的生活。好久不见,不知道大家新年过得怎么样?有没有痛痛快快得放松?是不是还能收到很多压岁钱?好了,话不多说,我们开......
  • [Typescript 5.0] const Type Parameters with readonly
    https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#exhaustive-switch-case-completions Intheexamplecode:typeHasNames={names:r......
  • coredns mysql 扩展使用+readyset 试用
    基于db进行dns记录的管理还是比较有用的,尤其在一些开发环境中,以下是一个使用同时也会尝试集成readyset(但是木有成功,应该是mysql编码兼容的问题)添加&构建插件方法比较简......
  • readyset 轻量级pg 以及mysql 缓存引擎
    readyset是基于rust开发的pg以及mysql轻量级缓存服务参考玩法如下图  说明readyset一些设计还是很有意思的,很值得学习,同时也可以在项目中尝试使用参考资料​​https:/......