Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# -*- coding: utf-8 -*-
import urllib
import json
from pprint import pprint
# get the web page
url = 'https://www.rally-maps.com/Rallye-Monte-Carlo-2017/Agnières-en-Dévoluy-Le-Motty#ElevationChart'
f = urllib.urlopen(url)
# find the relevant line
for line in f:
if 'elevationData:' in line:
csvline = line[22:-3]
for item in csvline.split("},"):
# print("item: " + item[1:-1])
components = item[1:-1].split(',')
lng = components[0].split(':')[1]
lat = components[1].split(':')[1]
ele = components[2].split(':')[1]
print("lng: " + lng + " lat: " + lat + " ele: " + ele + "\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.