Skip to content

Instantly share code, notes, and snippets.

@bouk
Created May 19, 2013 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bouk/5609067 to your computer and use it in GitHub Desktop.
Save bouk/5609067 to your computer and use it in GitHub Desktop.
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