Created
May 19, 2013 21:24
-
-
Save bouk/5609067 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import urllib2 | |
def main(): | |
page = urllib2.urlopen("http://www.weersvoorspelling.nl/weer-nederland/culemborg/per-uur/8387") | |
doc = BeautifulSoup(page.read()) | |
for row in doc.find(class_='forecastTable').find_all('tr'): | |
cells = row.find_all('td') | |
if len(cells) != 7: | |
continue | |
print "Om %s is het %s" % (cells[0].get_text(), cells[2].find('strong').get_text()) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment