Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrobenito committed Aug 21, 2016
1 parent 776df8d commit 3cd391f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scraper.py
Expand Up @@ -10,10 +10,10 @@
root = lxml.html.fromstring(html)
data = []
for linkText in root.cssselect("a[class='textlink']"):
data.append({"title" : linkText.text_content(), "url" : linkText.get('href')})
data.append({"title" : linkText.text_content().encode('utf-8'), "url" : linkText.get('href').encode('utf-8')})

for row in data:
print row['title'].decode("utf8","ignore")
print row['title']
# scraperwiki.sqlite.save(unique_keys=['url'], data={"title" : row['title'], "url" : row['url']})

#scraperwiki.sqlite.save(unique_keys=['url'], data=data)
Expand Down

0 comments on commit 3cd391f

Please sign in to comment.