Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
Logan Harvey
Logan Harvey el 18 de Jul. de 2014
Comentada: Jan el 20 de Dic. de 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 comentarios
Jan
Jan el 20 de Dic. de 2016
How ugly is "eval(['load ' files(i).name ' -ascii']);"?!
load(files(i).name, '-ascii');

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by