Today I was tinkering with an idea involving parsing a Html file by taking an XML structure and building a simple xquery engine in python. I know...most of my "World changing ideas" finally end up on my unfinished/fragile Github Project category. But knowing how it's gonna help me in long drive I tried to give it a shot anyway. And this is when I discovered lxml and immediately fell in love with it. But rather going to the intricacies I'm gonna share how simple it was for me to pars an xml file with it. First, we'll make sure we have everything in place. Things we need lxml Yeah...that's kinda only thing you'll need :) (and of course Python!!!). If you are sing Ubuntu or Xubuntu (like me) then just goto synaptics package manager and install it. Or get it from the website if you are gonna tinker in windows. Now, let's assume that we want to parse a xml file named 'file.xml' with the following content:
This is my mindless rambling.