%% Detect and Use Import Options for HTML File
% Detect import options for an HTML file, specify the table to import, and then read the data.
% Detect the import options of the first table from the URL https://www.mathworks.com/help/matlab/text-files.html containing the text "readtable". Detect the import options using the detectImportOptions function and specify the table to read using the XPath query "//TABLE[contains(.,'readtable')]". Specify to not read variable names by setting ReadVariableNames to false.

url = "https://www.mathworks.com/help/matlab/text-files.html";
opts = detectImportOptions(url,'TableSelector',"//TABLE[contains(.,'readtable')]",'ReadVariableNames',false)

% Read the table using the readtable function.

T = readtable(url,opts)

% Copyright 2021 The MathWorks, Inc.