Fetching "Inspect Elements" from HTML
11 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Guillaume
2015-9-7
编辑:Guillaume
2015-9-7
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 个评论
Cedric
2015-9-8
编辑:Cedric
2015-9-8
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!