From: shanti bhushan on
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.
regards
Shanti Bhushan
Bangalore,India
From: Stefan Behnel on
shanti bhushan, 17.05.2010 10:34:
> 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.

Note that web sites usually are HTML, not XML. Are you sure you want to
read XML as well? Also, DOM/SAX are certainly not the easiest way to
extract information from XML, use the xml.etree.ElementTree package instead.

To parse HTML from web pages, you can use several different tools in
Python, see

http://www.google.com/search?q=python+web+scraping

Stefan

From: Franz Kelnreiter on
2010/5/17 shanti bhushan <ershantibhushan(a)gmail.com>:
> 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.
Hi Shanti,
The question how to read an XML file has already been answerd more
than 50 times within this group. So I fear nobody wont any longer be
willing to repeat this matter every 15 days...
Greetings,
Franz
From: Simon Brunning on
On 17 May 2010 09:34:51 UTC+1, shanti bhushan <ershantibhushan(a)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.
From: superpollo on
Simon Brunning ha scritto:
> On 17 May 2010 09:34:51 UTC+1, shanti bhushan <ershantibhushan(a)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.

btw, is there any chance that bs will be part of the stdlib anytime soon?

bye