> Date: Fri, 17 Jul 2009 12:27:36 +0200
> From: mot...@xs4all.nl
> To: tutor@python.org
> CC: pine...@hotmail.com
> Subject: Re: [Tutor] weather scraping with Beautiful Soup
> 
> Che M wrote:
> 
> > The 60.3 is the value I want to extract.
> 
> soup.find("div",id="curcondbox").findNext("span","b").renderContents()


Thanks, but that isn't working for me.  Here's my code:

---------
import urllib2
from BeautifulSoup import BeautifulSoup

url = "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=43085";
page = urllib2.urlopen(url)
soup = BeautifulSoup(page)

daytemp = soup.find("div",id="curcondbox").findNext("span","b").renderContents()

print "Today's temperature in Worthington is: ", daytemp
---------

When I try this, I get this error:

HTMLParseError: malformed start tag, at line 1516, column 60

Could someone suggest how to proceed?

Thanks.
CM



_________________________________________________________________
Windows Live™ SkyDrive™: Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to