Reputation: 317
I was wondering if it is possible to scrape data from the following interactive map:
I tried to scrape it following the instructions here
However, after clicking on Network, then XHR, I get the following error:
{"error":{"code":400,"message":"Bad Request"}}
I understand that some interactive maps such as ones designed with Microsoft Power BI are impossible/difficult to scrape, but I was wondering if we can find the data underlying the interactive map above.
Upvotes: 1
Views: 1170
Reputation: 2045
This example interactive map uses an API for its data, located at https://api.map.910ths.sa/api/graphql/ . It takes POST requests. The output data is something like this:
{"data":{"businesses":{"aggregationByArea":{"areaBuckets":[{"area":{"id":"city-3","location":{"latitude":24.699999961,"longitude":46.733330032}},"size":147136}]},"size":147136}}}
You can find the data reqeusts as graphql:
I suggest you read into scraping API's with python:
Upvotes: 1