Mar-28-2017, 03:53 PM
Would like to learn more about how to scrape data using openchargemap.org/site/develop/api
for the tinkering around.
Specifically, extract all the point data (with attributes) from their main database.
Have read through their docs / dev and don't see a clear cut way to access this data.
Was given the following code on a forum to do this here, **note** i had to remove
https://
from resp = requests.get('______ api.openchargemap.io/v2/poi/')
since clickable links are not allowed yet.
Any help would be appreciated.
for the tinkering around.
Specifically, extract all the point data (with attributes) from their main database.
Have read through their docs / dev and don't see a clear cut way to access this data.
Was given the following code on a forum to do this here, **note** i had to remove
https://
from resp = requests.get('______ api.openchargemap.io/v2/poi/')
since clickable links are not allowed yet.
import requests resp = requests.get('api.openchargemap.io/v2/poi/') data = resp.json() for d in data: id = d['ID'] operator_id = d['OperatorID'] lat = d['AddressInfo']['Latitude'] lon = d['AddressInfo']['Longitude'] print('{0} | {1} | {2} | {3}'.format(id, operator_id, lat, lon))which produces:
SyntaxError: multiple statements found while compiling a single statementand when running just
import requestsget the following:
Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import requests ModuleNotFoundError: No module named 'requests'Downloaded and installed Python 3.6.1 (i was on 2.7 which i did not uninstall) using Windows 7 with Python 3.6.1 Shell
Any help would be appreciated.