-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscraper.py
More file actions
15 lines (12 loc) · 839 Bytes
/
scraper.py
File metadata and controls
15 lines (12 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from dc_base_scrapers.geojson_scraper import GeoJsonScraper
from dc_base_scrapers.hashonly_scraper import HashOnlyScraper
search_url = "https://opendata.arcgis.com/api/v3/datasets?q=polling&filter%5Bowner%5D=Broxtowe_GIS&fields[datasets]=name,url"
stations_url = "https://opendata.arcgis.com/datasets/a3da8ff112a647fe857a45c9996488fd_3.geojson"
districts_url = "https://opendata.arcgis.com/datasets/ace0ecbc348a41b5b804557f6a68f575_1.geojson"
council_id = 'BRT'
search_scraper = HashOnlyScraper(search_url, council_id, 'datasets', 'json')
# search_scraper.scrape(exclude_keys=['meta'])
stations_scraper = GeoJsonScraper(stations_url, council_id, 'utf-8', 'stations', key='OBJECTID')
stations_scraper.scrape()
districts_scraper = GeoJsonScraper(districts_url, council_id, 'utf-8', 'districts', key='OBJECTID')
districts_scraper.scrape()