Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   parsing response from SOAPpy request (http://www.velocityreviews.com/forums/t534133-parsing-response-from-soappy-request.html)

seancron 08-31-2007 11:06 PM

parsing response from SOAPpy request
 
I'm using SOAPpy to access weather data from the NOAA National Digital
Forecast Database XML Web Service [1] and I've been having
trouble figuring out how to parse the data.

The response comes back as XML document but when I check it with
type(result) it shows the the response is a string. Does anyone have
any
suggestions on getting relevant data?

Thanks,
-Sean

[1] http://www.weather.gov/forecasts/xml/


Larry Bates 08-31-2007 11:42 PM

Re: parsing response from SOAPpy request
 
seancron wrote:
> I'm using SOAPpy to access weather data from the NOAA National Digital
> Forecast Database XML Web Service [1] and I've been having
> trouble figuring out how to parse the data.
>
> The response comes back as XML document but when I check it with
> type(result) it shows the the response is a string. Does anyone have
> any
> suggestions on getting relevant data?
>
> Thanks,
> -Sean
>
> [1] http://www.weather.gov/forecasts/xml/
>

XML data is just a string of characters. Use elementree xml parser (built into
Python 2.5 available for download for prior versions) to parse it for what you
want to extract.

-Larry


All times are GMT. The time now is 10:53 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.