Can MATLAB control a website and extract data from it?

조회 수: 26 (최근 30일)
Chris Gehrke
Chris Gehrke 2022년 9월 9일
댓글: Rik 2022년 9월 13일
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개)

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by