How do I get the content between two xml tags in python? -
import xml.dom.minidom water = """ <channel> <item> <title>water</title> <link>http://www.water.com</link> </item> <item> <title>fire</title> <link>http://www.fire.com</link> </item> </channel>""" dom=xml.dom.minidom.parsestring(water) linklist = dom.getelementsbytagname('link') print (len(linklist)) using minidom, want content between link , /link string. please let me know how to. if want stick xml.dom.minidom call .firstchild.nodevalue. example, stored links in variable "linklist", print them iterate through them , call .firstchild.nodevalue, this... for link in linklist: print link.firstchild.nodevalue prints... http://www.water.com http://www.fire.com more detailed answer here.... get element value minidom python in response other question: if wanted specific element need know either in document or search it. for ex...