File Exchange

image thumbnail

Get HTML Table Data into MATLAB

version (27.6 KB) by Jeremy Barry
Identify tables and interactively select the data to bring into MATLAB.


Updated 01 Sep 2016

View Version History

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

Through the MATLAB Web Browser tables are identified and are interactively selected and the data is imported into MATLAB as a cell array.

Cite As

Jeremy Barry (2021). Get HTML Table Data into MATLAB (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (27)

Helge Hopf

doesnt work anymore

Alexis Guamán

Error.... File "mlPage.jpg" does not exist.


Great work, but I have a problem about this:
Error using imread (line 349)
File "mlPage.jpg" does not exist.

Error in getTableDataScript (line 18)
im = imread('mlPage.jpg');
Thank u very much.

Edson Barbosa

Very useful and helpful, but for Linux users, matlab identifies tables, columns, and lines with capital letters.
So, you need to replace all "table" for "TABLE", "td" for "TD" and "tr" for "TR". Thank you

Edson Barbosa






I keep getting this:

Undefined function or variable

Error in getTableFromWeb (line 31)
activeBrowser =

I'm not sure how to solve this.
Thank you.

Germán Lopez

Error using imread (line 349)
File "mlPage.jpg" does not exist.

Error in getTableDataScript (line 15)
im = imread('mlPage.jpg');



Thanks! It works perfect.


the script doesn't work. There is no file




this is a very usefull work! and it works great.
i have just some little problem about the type of information lead into cells:

for finance analisy's porpouse i need to have numbers into cells instead of 'char'. any ideas about how to change it?

thanks so much. anyway, great work!


not working for me. What is required version?

Richard Crozier

Great, thanks!

Jesse Blocher


Great tool! I've been using it to download daily stock option price for a class assignment. So cool to have this automatically down

Sven Koerner

Great Tool!



Yuri K

Unfortunately does not take properly table with rowspan (probably colspan as well, I didn't test).

Yuri K

Sorry, somehow I didn't send the full comment. This is great tool and I looked for such functionality in MATLAB. One issue is that it searching for the icon in current directory. It better to store it together with the function. Use fileparts(which(mfilename)) instead of pwd.

Yuri K

Even better which(mfilename)

Michael Solis Chacon

Don't work for me, any suggestion

>> getTableDataScript
??? Attempt to reference field of non-structure array.

Error in ==> getTableFromWeb>updateHTML at 47
pageString = reshape(url.toCharArray, 1, []);

Error in ==> getTableFromWeb at 36
newUrlText = updateHTML(urlText);

Error in ==> getTableDataScript at 14

Anders Brun

Nice thing. Too bad the Matlab web browser doesn´t have the same functionality as other browsers though... I could not even load the page that I am most interested in importing. Then again, I could ofcourse save this page as HTML using Firefox, Safari or Explorer and then use your tool to import it into Matlab, which is nice since I don´t have to open up Excel.



MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!