Skip to content

Commit

Permalink
Create scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
walinchus committed Jun 14, 2017
1 parent 5c5a0c1 commit 4f2619f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scraper.py
Expand Up @@ -28,16 +28,16 @@ def scrape_table(root):
#idno=idno+1
#record['ID'] = idno
print record, '------------'
rows2 = root.cssselect("table.CountDescription tr")
rows2 = root.cssselect("div.CountsContainer tr")
#create a record to hold the data
#record = {}
#for each row, loop through this
for row2 in rows2[0:len(rows2)]:
for row2 in rows2[0:)]:
#create a list of all cells <td> in that row
table_cells2 = row2.cssselect("td")
if table_cells2:
#if there is a cell, record the contents in our dataset, the first cell [0] in 'recipient' and so on
record['Charge'] = table_cells2.text_content()
record['Charge'] = table_cells2[0].text_content()
#record['Date Filed and Judge'] = table_cells[1].text_content()
#this line adds 1 to the ID no. we set at 0 earlier
#idno=idno+1
Expand Down

0 comments on commit 4f2619f

Please sign in to comment.