Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bdoln committed May 5, 2017
1 parent 112b983 commit ad97bbd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scraper.py
Expand Up @@ -17,14 +17,14 @@ def scrape_table(root):
# Set up our data record - we'll need it later
record = {}
table_cells = row.cssselect("td") if table_cells:
record['Artist'] = table_cells[0].text
record['Album'] = table_cells[1].text
record['Released'] = table_cells[2].text
record['Sales m'] = table_cells[4].text
# Print out the data we've gathered
print record, '------------'
# Finally, save the record to the datastore - 'Artist' is our unique key
scraperwiki.sqlite.save(["Artist"], record)
record['Artist'] = table_cells[0].text
record['Album'] = table_cells[1].text
record['Released'] = table_cells[2].text
record['Sales m'] = table_cells[4].text
# Print out the data we've gathered
print record, '------------'
# Finally, save the record to the datastore - 'Artist' is our unique key
scraperwiki.sqlite.save(["Artist"], record)

#scrape_and_look_for_next_linkfunction:callsthescrape_table
#function,thenhuntsfora'next'link:ifoneisfound,callsitselfagain
Expand Down

0 comments on commit ad97bbd

Please sign in to comment.