The etree function under the lxml library can be imported under the python IDE, but the etree function under the lxml library cannot be imported into pycharm. Solution

 
 
from lxml import html #python3以上的版本把etree换成了html
etree=html.etree  #用这种方法才能导入etree

I personally tested it and the function can be used normally. If it helps you, please give me a thumbs up.

Guess you like

Origin blog.csdn.net/m0_63533079/article/details/125984840