From f3686365d535b61e61cc1e36c57f3de10e0386c8 Mon Sep 17 00:00:00 2001 From: Lucia Walinchus Date: Thu, 15 Jun 2017 14:39:51 -0500 Subject: [PATCH] Update --- scraper.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scraper.py b/scraper.py index 385eb59..5a31b46 100644 --- a/scraper.py +++ b/scraper.py @@ -29,13 +29,12 @@ def scrape_table(root): #record['ID'] = idno print record, '------------' counts = root.cssselect("div.CountsContainer") - print counts.text_content() - '''countstotal = len(counts) + countstotal = len(counts) print "total number of counts:", countstotal #countsrange = range(0, countstotal+1) #for count in countsrange: for count in counts: - rows = count.cssselect('tr') + rows = count.cssselect('div.CountsContainer tr') if rows: id = 0 #rowstotal = len(rows) @@ -52,7 +51,7 @@ def scrape_table(root): #print table_cells record['Charges'] = table_cells[0].text_content() record['Count Description:'] = table_cells[1].text_content() - record['Outcome:'] = table_cells[3].text_content() + #record['Outcome:'] = table_cells[3].text_content() print record, '------------' # Save the record to the datastore - 'ID' is our unique key - ''' print 'ALL DATA:', record