How can I get data from a website?

5 ビュー (過去 30 日間)
Albert Añaños
Albert Añaños 2020 年 2 月 20 日
回答済み: Albert Añaños 2020 年 2 月 24 日
Hi, I am trying to read financial data from pages like this one: https://www.investing.com/funds/bankinter-indice-america-fi-historical-data
I think it's not a RESTful site (probably uses javascript), so webread does not work here.
I have also tried urlfilter, but it misses the dates.
Is there an easy way to get that type of data into MATLAB? Thanks!

採用された回答

Albert Añaños
Albert Añaños 2020 年 2 月 24 日
Thank Jalaj!
I followed the examples and found a quick way to do this:
url_string = ('https://www.investing.com/funds/bankinter-indice-america-fi-historical-data');
nr_table = 1;
out_table = getTableFromWeb_mod(url_string, nr_table);
The function getTableFromWeb_mod simplifies all the complexity of using regexp, multiple tables in the page, etc.

その他の回答 (1 件)

Jalaj Gambhir
Jalaj Gambhir 2020 年 2 月 24 日
Hi,
You can use a combination of webread and regexp, to extract the required table (in this case, has class = "genTbl closedTbl historicalTbl"). You can refer to examples here.

カテゴリ

Help Center および File ExchangeWeb Services についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by