Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
Logan Harvey
Logan Harvey am 18 Jul. 2014
Kommentiert: Jan am 20 Dez. 2016
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.
  2 Kommentare
Jan
Jan am 20 Dez. 2016
How ugly is "eval(['load ' files(i).name ' -ascii']);"?!
load(files(i).name, '-ascii');

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by