我想在 python 中使用 xpath 。我试过了
import xml.etree.ElementTree as ET
由于这个库的使用有限,我在谷歌上进行了长时间的搜索后不得不使用 lxml。我在安装过程中遇到了几个问题,最后我安装了 lxml 但是当我使用
from lxml import etree
它会返回如下错误。你能告诉我这个问题的解决方案吗!!!
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
from lxml import etree
ImportError: DLL load failed: %1 is not a valid Win32 application.
any1 能告诉我问题是什么吗?? 感谢您的帮助!!
最佳答案
我知道现在说这个已经晚了......但有一天可能会帮助别人..
我在这里使用下面的代码来解决完全相同的问题
python -m pip uninstall lxml
python -m pip install lxml==3.6.0
关于python - 在 lxml 中使用 etree 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16296050/