Created
February 20, 2012 20:19
-
-
Save csessig86/1871166 to your computer and use it in GitHub Desktop.
Timeline.py part 1
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
import urllib2 | |
from BeautifulSoup import BeautifulSoup | |
import datetime | |
import re | |
now = datetime.datetime.now() | |
# Create a CSV where we'll save our data. See further docs: | |
# http://propublica.github.com/timeline-setter/#csv | |
f = open('timeline.csv', 'w') | |
# Make the header rows. These are based on headers recognized by TimelineSetter. | |
f.write("date" + "," + "description" + "," + "link" + "," + "html" + "\n") | |
# URL we will scrape | |
url = 'http://wcfcourier.com/test/scrape/dunkerton/' | |
page = urllib2.urlopen(url) | |
soup = BeautifulSoup(page) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment