%% Create Import Options for HTML File
% Create import options for an HTML file, specify the table to import, and then read the data.
% Create an HTMLDocumentImportOptions object. Read from the first table containing the word "readtable" using the XPath query "//TABLE[contains(.,'readtable')]".

opts = htmlImportOptions('TableSelector',"//TABLE[contains(.,'readtable')]")

% Read the table from the URL https://www.mathworks.com/help/matlab/text-files.html using the readtable function with the options object.

url = "https://www.mathworks.com/help/matlab/text-files.html";
T = readtable(url,opts)

% Copyright 2021 The MathWorks, Inc.