From ddf1c774533f0229cc5817825994fa74cfbe0f81 Mon Sep 17 00:00:00 2001 From: AlexandruBratu <43742145+AlexandruBratu@users.noreply.github.com> Date: Tue, 26 Feb 2019 12:07:46 +0000 Subject: [PATCH] Update scraper.py --- scraper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scraper.py b/scraper.py index 7da3592..3784228 100644 --- a/scraper.py +++ b/scraper.py @@ -1,4 +1,3 @@ - # This is a template for a Python scraper on morph.io (https://morph.io) # including some code snippets below that you should find helpful @@ -13,11 +12,13 @@ root.cssselect("li p a") # matchedlinks=root.cssselect("li p a") -print(matchedlinks) -# +# print(matchedlinks) +record={} for li in matchedlinks: listtext=li.text_content() print(listtext) + record['address'] = listtext + scraperwiki.sqlite.save(['address'],record) # # Write out to the sqlite database using scraperwiki library # scraperwiki.sqlite.save(unique_keys=['name'], data={"name": "susan", "occupation": "software developer"}) #