解决 python3 中 lxml 最新版本没有 etree 的问题

使用 python3.6 时安装好 lxml 时按照许多网上的教程来引入会发现 etree 没被引入进来
解决办法:

import lxml.html
etree = lxml.html.etree

这样就可以使用 etree 了

猜你喜欢

转载自blog.csdn.net/weixin_41474364/article/details/84304694