I'm trying to parse out some XML nodes with namespaces using
BeautifulSoup. I can't seem to get the syntax correct. It doesn't like
the colon in the tag name, and I'm not sure how to refer to that tag.

I'm trying to get the attributes of this tag:

<yweather:forecast day="Sun" date="18 Feb 2007" low="39" high="55"
text="Partly Cloudy/Wind" code="24">

The only way I've been able to get it is by doing a findAll with
regex. Is there a better way?

----------

from BeautifulSoup import BeautifulStoneSoup
import urllib2

url = 'http://weather.yahooapis.com/forecastrss?p=33609'
page = urllib2.urlopen(url)
soup = BeautifulStoneSoup(page)

print soup['yweather:forecast']

----------

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to