Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lexie11 committed Jul 28, 2019
1 parent b6cd9de commit 50f001f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scraper.py
Expand Up @@ -4,9 +4,9 @@
root = lxml.html.fromstring(html) # turn our HTML into an lxml object
tds = root.cssselect('td') # get all the <td> tags
for td in tds:
print td.text_content() # just the text inside the HTML tag including inside children, without markup
print td.tag() # just the text inside the HTML tag including inside children, without markup
for td in tds:
record = { "td" : td.text } # column name and value
record = { "td" : td.tag } # column name and value
try:
scraperwiki.sqlite.save(["td"], record) # save the records one by one
except:
Expand Down

0 comments on commit 50f001f

Please sign in to comment.