The htmlTree object is supported in which version?

My matlab is R2016b, I can't open the htmlTree(), and extractHTMLText() functions. I wonder if the htmlTree object is supported in R2016b? Or I need to add on extra toolbox/module? Please let me know how do I get those fuctions. Thanks.

Answers (1)

According to the note at the end of the htmlTree function's documentation page it was introduced in release R2018b. You will need to upgrade to this release or later and have Text Analytics Toolbox installed (as dpb pointed out, this function is in this toolbox) in order to use it.

4 Comments

Thanks dpb and Steven. I'm able to upgrade my matlab to 2020a, will try this first.
For the Text Analytics Toolbox, I don't have license. It seems to be expensive.
When you parse the info from the file read from website by webread() function, do you think it's necessary to use the htmlTree object? Or there is other ways, such as simply search the data I want by regexp?
I think that will all depend on the web site and the data you're trying to retrieve. Start by reading the doc for webread and links from it that give some examples.
Mostly it probably depends upon whether the web site is set up to be a data source or whether you're trying to "scrape" the content out of a display page or what...
You'll just have to try it and see what you get for starters and figure out what need to do from there...
Thank you very much dpb.
I'm actually starting learning how to "scrape" data from websites now, no specific content target yet.
Currently, I can get the webread() return file from websites with varies format, eg. data (api) html or image files. I have trouble reading the html file to get the info I interested, I don't know how to map the content displayed on website to the loaction in its source file. For that purpose, do you have any suggestion for me, do I need to learn the xml/Json file format? or some specific functions in matlab would help? Or did you mean that there is no general rules, every website is different, then how do you find the location for a new website?
You're past my knowledge base there...I've never delved into web development so to quote Sgt Schultz, "I know nuthink!" about the details.
I'd guess the latter is probably mostly true that a generic web page returned as an html page requires parsing the html to extract the info.
I'm sure there are tools to do this, but see the previous quote regarding my level of knowledge regarding what those would be...

Sign in to comment.

Asked:

on 4 Jul 2020

Commented:

dpb
on 7 Jul 2020

Community Treasure Hunt

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

Start Hunting!