Python爬虫——使用lxml库中的etree模块时显红报错,但又可以正常运行

ImportError: cannot import name ‘etree’ from ‘lxml’ 今天在做网络爬虫的时候,需要用上xpath,环境中已经安装了lxml库,结果引入的时候,显红报错,如图所示: 我的环境是 python3.7.4 +lxml 4.4.1 编译器:PyCharm 报错原因: python3.5之后的 lxml 库中不能直接引入etree模块,新的版本无法直接使用“
相关文章
相关标签/搜索