Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbradshaw committed Apr 5, 2017
1 parent 57fca02 commit 9a9d06c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scraper.py
Expand Up @@ -36,7 +36,6 @@
#now to loop through the 'sheetsrange' variable (a list) and put each item in 'sheetnum'
for sheetnum in sheetsrange:
print "scraping sheet ", sheetnum
sheetnum = str(sheetnum)
#use the sheet_by_index method to open the first (0) sheet in variable 'book' - and put it into new variable 'sheet'
sheet = book.sheet_by_index(sheetnum)
#use the row_values method and index (1) to grab the second row of 'sheet'
Expand Down Expand Up @@ -70,6 +69,7 @@
record['id'] = "TEST"
print "---", record
#if sheet.row_values(rownumber)[3] != '':
sheetnum = str(sheetnum)
scraperwiki.sqlite.save(["id"], record, table_name=sheetnum)
#some cells don't have a number, but a dash
#they generate the error: (exceptions.ValueError) could not convert string to float
Expand Down

0 comments on commit 9a9d06c

Please sign in to comment.