%% Convert Parsed HTML Code to String
%  Read HTML code from the URL https://www.mathworks.com/help/textanalytics using the webread function.

url = "https://www.mathworks.com/help/textanalytics";
code = webread(url);

% Parse the HTML code using the htmlTree function.

tree = htmlTree(code);

% Find all the paragraphs in the HTML tree using the findElement function. The paragraphs are the nodes with element name "P".

subtrees = findElement(tree,"P");

% Convert the subtrees to string using the string function.

str = string(subtrees)

% Copyright 2021 The MathWorks, Inc.