Can MATLAB control a website and extract data from it?

23 次查看(过去 30 天)
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).
Any ideas?
Much appreciated,
Chris

采纳的回答

Rik
Rik 2022-9-9
编辑:Rik 2022-9-13
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]
  2 个评论
Chris Gehrke
Chris Gehrke 2022-9-13
移动:Rik 2022-9-13
Thanks Rik, I was able to find the API which is much easier to deal with.
Rik
Rik 2022-9-13
You're welcome.
When working with code it is often indeed easier to skip the step where the data is formatted for human readers.

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by