There is an online atlas that I would like to extract values from. The atlas provides a tool ('Query') to extract values when you click a location or enclose a region on the map, or you can specify the latitude/longitude of a point where you want the value. Instead of extracting values manually, I would like automate data extraction using the command line; either I'd write a script to pull out values for an input longitude/latitude, or pull out all values for all locations, as long as I can also get the latitude/longitude of the returned points. What utility could scrape the data from the atlas, and be part of a command line script? scrapy looks promising but maybe there are better tools for this. Or if you could tell me what language the 'Query' tool uses, it would help me get started.
I suggest doing the following as a first start:
- Install Firefox
- Install the Tamper Data addon
- Load the site, start tampering
- Play around with the query tool and have a look on the XMLHttpRequests you automatically generate (see Tamper Data logs)
Since all requests are most probably just HTTP GET and HTTP POST requests with specific parameters, you could start automating e.g. with a tool like
scrapy indeed looks promising and seems to bring a lot of nice features (didn't test it myself, though).
Instead of using Firefox with the Temper Data addon, you can also use any other browser while capturing the HTTP traffic e.g. with wireshark.