Fetching "Inspect Elements" from HTML
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Guillaume
il 7 Set 2015
Modificato: Guillaume
il 7 Set 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 Commenti
Cedric
il 8 Set 2015
Modificato: Cedric
il 8 Set 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.
Vedere anche
Categorie
Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!