Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import xml.etree.ElementTree as et
- xtree = et.parse("GLAWI_FR_work_D2015-12-26_R2016-05-18.xml")
- xroot = xtree.getroot()
- for node in xroot:
- title = node.find("title")
- print("Mot scanné :")
- print(title.text)
- text = node.find("text")
- pos = text.find("pos")
- if pos is not None:
- attrib = pos.attrib.get("type")
- if attrib == "verbe":
- print("WESH JE CROIS QUE C'EST UN VERBE : "+title.text)
- print("pingouin")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement