I was using xpath in python 2.4 and it was working fine.
But when I switch to python 2.7 and try to import the xpath library, it complains xpath doesn’t exist:
from xml import xpath
Does anyone know if xpath exist in python 2.7?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to use xpath with python 2.7,
xml.etree.elementTreeis part of the standard library since Python 2.5 and it contains a basic xpath findall function. PyXML is outdated and shouldn’t be used.If you need something more powerful, I would install lxml.