reading XML file using python

Simon Brunning simon at brunningonline.net
Mon May 17 05:12:39 EDT 2010


On 17 May 2010 09:34:51 UTC+1, shanti bhushan <ershantibhushan at gmail.com> wrote:
> Hi ,
> i am new to python.i want to read the XML file using python it ,by
> using DOm or SAX any of them.
> I want to read the http://www.google.com(any hyper text) from XML and
> print that.
> please give me the sample program for this.

Your question isn't very clear. Do you want to read the data from a
URL (such as http://www.google.com) and parse it? If so, you probably
don't want an XML parser as such - try Beautiful Soup.

Or do you have a piece of XML with some URLs in it that you want to
extract? ElementTree in the standard library is one good choice here
if you're not wedded to one of DOM or SAX.

What have you tried so far? No one is going to write code for you, but
we'd be happy to help you fix problems with your own code.
<http://catb.org/~esr/faqs/smart-questions.html> might be worth a
read.

-- 
Cheers,
Simon B.



More information about the Python-list mailing list