[Tutor] weather scraping with Beautiful Soup

Alan Gauld alan.gauld at btinternet.com
Fri Jul 17 08:45:55 CEST 2009


"Che M" <pine508 at hotmail.com> wrote

Grabbing Weather Underground Data with BeautifulSoup
http://flowingdata.com/2007/07/09/grabbing-weather-underground-data-with-beautifulsoup/

But I get to the exact same problem that this other person got to in this 
post:
http://groups.google.com/group/beautifulsoup/browse_thread/thread/13eb3dbf713b8a4a

> Unfortunately, that post never gives enough help for me to
> understand how to solve that person's or my problem.


The posts basocally say go and look at the HTML and find the
right tags for the data you need. This is fubndamental to any kind of web
scraping, you need to understand the HTML tree well enough to identify
where yourt data exists.

How familiar are you with HTML and its structures?
Can you view the source in your browser and identify the heirarchy
of tags to the place where your data lives?

> What I want to understand is how to find the bits of data you
> want--in this case, say, today's average temperature and whether
> it was clear or cloudy--within a web page,

Go to the web page and use View Source from your browser.

Then its down to you to interpret the HTML.
Somne experimentation with print statements might be necessary
to check you have the right place.

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/ 




More information about the Tutor mailing list