Clear Filters
Clear Filters

Import data from web and using button from the web

7 views (last 30 days)
Hi,
I want to be able to use button at webpage to get to another webpage, and extract data from the web.
At the moment i have this in VBA using getElementbyID,getElementbyTagName, etc.
can you please help me in finding the syntax to rewrite this program in matlab?
Alternatively, can I execute the VBA code from Matlab?

Answers (1)

Kautuk Raj
Kautuk Raj on 16 Feb 2024
I understand that you would like to import data from the web using MATLAB functions. I assume that you are using MATLAB R2023b.
In MATLAB, you can perform web scraping using the built-in "webread", "websave", "webwrite" and "weboptions" functions. These are RESTful web services functions which allow non-programmers to access many web services using HTTP GET and POST methods. More details about them can be found on the documentation page: https://www.mathworks.com/help/matlab/internet-file-access.html
As for executing VBA code from MATLAB, you can use MATLAB's COM Automation Server support to interact with applications that support VBA, such as Excel, and execute VBA scripts within those applications. An example on doing this can be found on this MATLAB Answers post here: https://www.mathworks.com/matlabcentral/answers/100938-how-can-i-run-an-excel-macro-from-matlab

Categories

Find more on Data Import from MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!