错误信息

TraitError: Could not decode 're.findall("\xe6\x9d\xa5\xe6\xba\x90\xef\xbc\x9a(.*)", web_source_info.encode("utf-8"))' for unicode trait '_i00' of a HistoryManager instance.

原因是网站的源码 编码格式不对

改下网站源码编码再匹配即可

root = Selector(type="html",text=response.body.decode('gb2312'))
web_source_info=""
web_source_arr = re.findall(u"来源:(.*)", web_source_info)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-12-18
  • 2021-06-03
猜你喜欢
  • 2021-12-14
  • 2022-12-23
  • 2021-06-30
  • 2022-01-21
  • 2021-11-29
  • 2021-11-22
  • 2022-12-23
相关资源
相似解决方案