在用python的lxml模块读取一个xml元素的时候,如果节点里面的属性包含中文,etree.tostring方法默认输出会出现乱码

【原创】关于lxml读取文件后不能正常输出中文

必须要设置方法 method=‘html’才能正常输出中文:

【原创】关于lxml读取文件后不能正常输出中文

 


 

相关文章:

  • 2022-12-23
  • 2021-12-10
  • 2021-11-05
  • 2021-10-19
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
猜你喜欢
  • 2021-06-25
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案