MATLAB 帮助中心
Find HTML trees without values
tf = ismissing(tree)
tf = ismissing(tree) returns a logical array that indicates which elements of tree do not reference HTML trees. For example, if tree is given by the Parent property of a root node, then the function returns 1 (true).
tf
tree
Parent
true
example
collapse all
To test if an HTML tree object represents a root node, test that the Parent property is missing.
Read HTML code from the URL https://www.mathworks.com/help/textanalytics using webread.
https://www.mathworks.com/help/textanalytics
webread
url = "https://www.mathworks.com/help/textanalytics"; code = webread(url);
Parse the HTML code using htmlTree.
htmlTree
tree = htmlTree(code);
Test if the parent of tree references an HTML tree.
tf = ismissing(tree.Parent)
tf = logical 1
Since tree represents the root node of the HTML tree, the value of tree.Parent is missing and the ismissing function returns 1 (true).
tree.Parent
missing
ismissing
HTML tree, specified as an htmlTree array.
Introduced in R2018b
extractFileText | extractHTMLText | readPDFFormData | htmlTree | findElement | getAttribute | tokenizedDocument
extractFileText
extractHTMLText
readPDFFormData
findElement
getAttribute
tokenizedDocument
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处