I am trying to scrape running routes, to geoprocess in R, from the following site: http://runkeeper.com/user/127244964/route/1149604
I am trying to do to that with this code:
from bs4 import BeautifulSoup import urllib2 import csv import os import requests page1 = urllib2.urlopen("http://runkeeper.com/user/212579518/route/513771") soup = BeautifulSoup(page1) print(soup)
When I print the results I see that the data that I need is on a text/javascript:
var routePoints = [{"latitude":38.918704,"longitude":-77.036478,"deltaDistance":0,"type":"StartPoint","altitude":40,"deltaPause":0}
I need to scrape the variables inside the dictionary. Any suggestions on how to do this?
Thanks.