当前位置: 代码迷 >> 综合 >> AttributeError: ‘NoneType‘ object has no attribute ‘find_all‘
  详细解决方案

AttributeError: ‘NoneType‘ object has no attribute ‘find_all‘

热度:61   发布时间:2023-11-26 19:13:05.0

相关链接

产生的原因:对象不存在这个方法

host_infos = html_tree.find("ul", {"id": "live-list-contentbox"})
host_list = host_infos.find_all("li")

这里报错的原因是host_infos是none,即第一次find结果不存在

  相关解决方案