Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikeikaas committed Oct 25, 2018
1 parent a40ab81 commit 8616117
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scraper.py
Expand Up @@ -51,9 +51,12 @@ def get_cell_value(element, css):

FIS_URL = "http://data.fis-ski.com/cross-country/results.html"
for link, raceinfo in race_link_results(FIS_URL):
# html = scraperwiki.scrape(link)
# root = lxml.html.fromstring(html)
# result_table = root.cssselect("table.fisfootable")[0]
html = scraperwiki.scrape(link)
root = lxml.html.fromstring(html)
result_table = root.cssselect("table.footable")[0]
result_cells = result_table.cssselect("tr")
for result_cell in result_cells:
print result_cell
print link
print raceinfo['date']
scraperwiki.sqlite.save(unique_keys=['codex'], data=raceinfo, table_name="data")
Expand Down

0 comments on commit 8616117

Please sign in to comment.