Alan Gauld wrote:
> "Sean Cronin" <[EMAIL PROTECTED]> wrote
>
>   
>> The response comes back as XML document but when I check it with
>> type(result) it shows the the response is a string.
>>     
>
> Thats right the string is the XML document, just as if you had read it
> from a file with the read() method.
>
>   
>> Does anyone have any suggestions on getting relevant data?
>>     
>
> You need to parse the xml.
>
> The classic way to do that is using DOM or sax parsing,

Bleah.  ;-)

>  but
> Python now has the ElementTree parser which is usually
> much easier to use. Look at the module docs and for a lot
> more detail visit the ElementTree homepage:
>
> http://effbot.org/zone/element-index.htm
>   

I've used ElementTree a tiny bit, but preferred BeautifulSoup as it 
seemed more "pythonic" to me.  You should look at both and pick the one 
that suits you.  BeautifulSoup has the advantage of not choking on 
choking on XML that is not well formed.

e.


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to