Fetching "Inspect Elements" from HTML
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello
So i dont know if this can be done or not, but i have not been able to find any posts about it. What i want to do is fetch information that changes in diffrent elements on a HTML page. To simply download the page source using URLread gives me nothing since the values are not stored there. It might just be my lack of knowledge about HTML that makes me ask this question, but so be it.
Thanks in advance
2 comentarios
Respuestas (1)
Guillaume
el 7 de Sept. de 2015
Editada: Guillaume
el 7 de Sept. de 2015
If the data you're interested in gets displayed through javascript then there's not much you can do short of implementing your own web browser (at least the javascript interpreting bit) in matlab or interacting with an existing browser. See this related discussion.
Possibly, the website you're accessing may have an API to fetch the data you want, most likely using xml. In that case, you could use webread.
4 comentarios
Cedric
el 8 de Sept. de 2015
Editada: Cedric
el 8 de Sept. de 2015
Image recognition will not work too well either, because you have to open pages manually, take a screen shot, etc, so this cannot be done on a regular and fast basis.
If I were you, I would try to see if I could access the content after the JS (or whatever else) is execute, from e.g.
web( 'https://svenskaspel.se/?pageid=/sport/oddsetlangen' )
or from Firefox. If you open the page in Firefox, right click on one of the numbers and select "Inspect element (Q)", you will see that the inspector tool displays the value. There may be a way to get this information from some plugin rather than the raw HTML source which contains the call.
Ver también
Categorías
Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!