I have a project with XML and I am trying to pull specific elements using XPath. Accessing the specific elements (a catalog of plants in this situation) I am using:
for attributes in root.findall("PLANT/[NAME = 'Rose']")
however, in this project, I am using parameters (in pycharm) so instead of using the name rose I need to put a variable in place of it instead. I’ve tried:
root.findall("PLANT/[NAME =" + sys.argv + "]")
But it does not work.