Pythonクローラーは対応するコードを自動的に認識します

res = s.get(urlTemp, headers=headers, timeout=5)
res.encoding = res.apparent_encoding
# html_ = etree.HTML(res.content.decode('gbk'))
print(res.text)

 

おすすめ

転載: blog.csdn.net/weixin_41822224/article/details/113104958