How can I read web page on-line with this code? Reply me pls

2 次查看(过去 30 天)
clear all; clc;
%strContents = fileread('008.html');
files = dir('*.html');
%hits = findstr(File,'services');
filename = 'FULLTEXT21.xlsx';
Sheet = 1;
xlRange = 'B135:B550';
for i = 1:435
%eval(['load ' files(i).name ' -ascii']);
expr ='<(title).*?>.*?</\1>';
strContents = fileread((files(i).name));
[tok mat nam] = regexpi(strContents, expr, 'tokens', 'match', 'names');
t = regexprep(mat,'<.*?>', '');
%abc(1,i)=t;
%fprintf('\n\n \t\ti=%d\n\n',i);
%pattern = '<title>';
%k = strfind(t, pattern);
%for i = 1:131
%data = load(matfile(i).name);
%matfbciles = dir(fullfile('D','Matlab Files','Matlab Tutorial','course-cotrain-data','fulltext','course', '*.html'));
%str = strcat('D:\Matlab Files\Matlab Tutorial\course-cotrain-data\fulltext\course', int2str(i),'.html');
%use our logic here
%before proceeding to the next file
%save pgdb matfiles;
%filetext = fileread(matfiles(1).name);
%xlswrite(filename,t,Sheet,xlRange);
xlsappend(filename, t, Sheet);
%save firefly.txt
end;
We can read HTML files we have but how can we read HTML files from web-page directly.
If you have answer or any suggestions please reply to us.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by