Hi all,
I have a problem: I need to change the "Date Range" in this webpage https://markets.ft.com/data/funds/tearsheet/historical?s=LU0546918409:EUR and than read the code using "webread" function:
As you can see, the standard range when the web is opening is the last 30 days, and I would like to change it. I tried with this code:
temp = webread('https://markets.ft.com/data/funds/tearsheet/historical?s=LU0546918409:EUR');
temp2 = strrep(temp,'2020/08/24','2020/07/24')
but i don't know how to reload the webpage with the new html code and date range. Someone can help me? Thanks!

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 9 月 23 日

0 投票

It is not as simple as using strrep(). You need to be able to control webpages interactively. I don't think MATLAB has any useful functions for such a thing. Your best bet is to use a python package of a web driver like selenium: https://selenium-python.readthedocs.io/ and see how can you interact with this webpage to change the date range. You can use the python libraries in MATLAB using resources at this link: https://www.mathworks.com/help/matlab/call-python-libraries.html

6 件のコメント

Rik
Rik 2020 年 9 月 23 日
Matlab does support RESTful connections. You can also use POST and GET requests.
If you are willing to dig a little deeper, you can also modify the URL you're reading:
https://markets.ft.com/data/equities/ajax/get-historical-prices?startDate=2020%2F08%2F17&endDate=2020%2F09%2F23&symbol=535667433
That is what my console shows under network activity when changing the date. Note that this format (and the response format) may change at any time and may require a lot of complex processing to parse into a useable format.
Adriano
Adriano 2020 年 9 月 23 日
Many many thanks Rik! That's what I was looking for. Thanks again!
Adriano
Adriano 2020 年 9 月 23 日
Just a question Rik: How did you get the symbol 535667433? Where did you find it? Thanks!
Rik
Rik 2020 年 9 月 23 日
I opened the console (ctrl+shift+i on Chrome) and went to the network tab. Then I changed the date. This URL was the result.
Adriano
Adriano 2020 年 9 月 23 日
Thanks again!
Ameer Hamza
Ameer Hamza 2020 年 9 月 23 日
Thanks Rik for the information.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

質問済み:

2020 年 9 月 23 日

コメント済み:

2020 年 9 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by