Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbradshaw committed Jan 25, 2018
1 parent 5908027 commit 7b1bdc5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scraper.py
Expand Up @@ -6,12 +6,16 @@
#
# # Read in a page
html = scraperwiki.scrape("https://uk.soccerway.com/teams/france/racing-club-de-strasbourg/898/")
#

record = {}

# # Find something on the page using css selectors
root = lxml.html.fromstring(html)
names = root.cssselect("td div a")
for name in names:
print name.attrib['href']
record['link'] = name.attrib['href']
scraperwiki.sqlite.save(unique_keys=['link'], data=record)
#
# # Write out to the sqlite database using scraperwiki library
# scraperwiki.sqlite.save(unique_keys=['name'], data={"name": "susan", "occupation": "software developer"})
Expand Down

0 comments on commit 7b1bdc5

Please sign in to comment.