forked from paulbradshaw/simple_csv_scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscraper.py
More file actions
16 lines (14 loc) · 762 Bytes
/
scraper.py
File metadata and controls
16 lines (14 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import scraperwiki
import csv
data = scraperwiki.scrape('https://www.sos.state.co.us/pubs/charities/reports/2016/tables/Table2-PaidSolicitorSummary2016.csv')
reader = csv.DictReader(data.splitlines())
for row in reader:
for key, value in row.iteritems():
print key
#row['Actual Funding Award'] = row['Actual Funding Award'].decode("latin-1")
#row['Annual Total 2012/2013'] = row['Annual Total 2012/2013'].decode("latin-1")
#row['Annual Total 2013/2014'] = row['Annual Total 2013/2014'].decode("latin-1")
#row['Annual Total2014/2015'] = row['Annual Total2014/2015'].decode("latin-1")
#row['Overall Total Paid'] = row['Overall Total Paid'].decode("latin-1")
print row['Ref. No.']
scraperwiki.sqlite.save(['Ref. No.'], row)