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 3e413f3 commit e8feae4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scraper.py
Expand Up @@ -58,13 +58,12 @@ def get_cell_value(element, css):
result_cells = result_table.cssselect("tr")
for result_cell in result_cells:
if len(result_cell.cssselect("td")) > 1:
athlete = result_cell.cssselect("td a")[0]
print athlete.text_content()
athlete_url = athlete.cssselect("a")[0].get("href")
parsed = urlparse.urlparse(athlete_url)
athlete_id = urlparse.parse_qs(parsed.query)['competitorid']
result = {
athlete = result_cell.cssselect("td a")[0]
print athlete.text_content()
athlete_url = athlete.cssselect("a")[0].get("href")
parsed = urlparse.urlparse(athlete_url)
athlete_id = urlparse.parse_qs(parsed.query)['competitorid']

'event': raceinfo['codex'],
'rank': result_cell.cssselect("td")[0].text_content(),
'athlete': result_cell.cssselect("td")[1].text_content(),
Expand Down

0 comments on commit e8feae4

Please sign in to comment.