Can MATLAB control a website and extract data from it?
3 views (last 30 days)
I don't have any code for this as I have no idea where to start. My exerience with MATLAB is largely complex number crunching, and I have a bit of experience with reading files. The conecpt of what I'm trying to do would be similar to interacting with Google Maps. The website I'm interested in interacting with is this one:
I'm developing a program where a user can input their postcode (zipcode) or surburb which then queries a database to find the latitude and longitude of that location (the data for that is in my own database and this code is separate).
Once the lat/long is known, I wish to "click" at those coordinates on the map. I'm assuming this could also be acheived using web(url,opt) and inputing the lat/long in the url such as this example:
Is the "clicking" option even possible? I assume I'd need to extract the page data so MATLAB knows the window size and can determine the appropraite position of the cursur based on that - seems overly complex so I'm hoping that navigating to the url is a valid option.
Where I really need help is once I'm at the location, I want a way toretreive the relevent information as shown in the below image:
I have read the documentation for urlread2 which I thought might be a solution, but the options don't seem to be what I'm after (or I don't understand it well enough).
Rik on 9 Sep 2022
Edited: Rik on 13 Sep 2022
My suggestion would be to look at the network tab of your browser's debugging tools to find out from where that data is loaded. Then you can probably directly query the backend data. You could get latitude and longitude with tools from the mapping toolbox (or if you're lucky, from the file exchange).
[moved to answer section]