PyXML on Ubuntu

前端 未结 2 1235
被撕碎了的回忆
被撕碎了的回忆 2021-01-22 17:26

I just completed a fresh install of Ubuntu 10.10 and I\'m trying to run some scripts that use xml and xpath. I get an error from inside PyXML.

I think this is an inst

2条回答
  •  一向
    一向 (楼主)
    2021-01-22 18:11

    PyXML should have been written for very old version of Python (< 2.4) and it used one of the later keywords 'as' as its variable. If your requirement is simple, you can just use ElementTree from Python Standard library which has support for XPath expressions. An example is here.

    For using the standard library module, do:

    from xml.etree.ElementTree import ElementTree
    

提交回复
热议问题