Pregunta

I would like to read some html using matlab. I've already tried urlread but got the url read error

Getting data into MATLAB from HTTPS:

so i tried using java with this:

Handling an invalid security certificate using MATLAB's urlread command.

unfortunately i don't know how to use java with matlab. so i tried this code and it seems to work

  url = 'https://stackoverflow.com/questions/11053664/use-java-in-matlab';
  is = java.net.URL([], url ).openConnection().getInputStream(); 
  br = java.io.BufferedReader(java.io.InputStreamReader(is));
  str = char(br.readLine());

however i would like to get the whole html page. so i can use regexp. My kingdom for some help

¿Fue útil?

Solución

There is a function in matlab that does that... The name is urlread!

See http://www.mathworks.com/matlabcentral/answers/973

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top