Python3.7安装lxml没有etree问题解决

1. 安装Python3.7环境以后用pip下载lxml4.4.1

pip install lxml==4.4.4

2. 在Python文件中使用方式:




from lxml import html

etree = html.etree
html = etree.parse('./hello.html')
result = etree.tostring(html, pretty_print=True)
print(result.decode('utf-8'))

你可能感兴趣的:(Python3.7安装lxml没有etree问题解决)