代码:
danmu_page=requests.get(url=danmu_url,headers=header).content
print(danmu_page)
tree=etree.HTML(danmu_page)
修改后的代码:
danmu_page=requests.get(url=danmu_url,headers=header).content.decode(‘utf-8’)
print(danmu_page)
tree=etree.HTML(danmu_page.encode(‘utf-8’))
原因暂时不清楚