필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
Logan Harvey
Logan Harvey 2014년 7월 18일
댓글: Jan 2016년 12월 20일
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
Jan
Jan 2016년 12월 20일
How ugly is "eval(['load ' files(i).name ' -ascii']);"?!
load(files(i).name, '-ascii');

댓글을 달려면 로그인하십시오.

답변 (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