Downloading and saving Excel files using Matlab

23 ビュー (過去 30 日間)
Joanna Przeworska
Joanna Przeworska 2021 年 5 月 18 日
コメント済み: Joanna Przeworska 2021 年 5 月 20 日
I would like to download this file: https://www.nbp.pl/en/statystyka/m3/podaz_bilansowa_en.xlsx and save it in the folder, all using Matlab. Is there any way I can do this? I red about 'urlread' and 'urlwrite' however do not know how exactly use it for my purpose.
  5 件のコメント
Rik
Rik 2021 年 5 月 18 日
And what if you try websave?
websave(filename,fullURL);
Joanna Przeworska
Joanna Przeworska 2021 年 5 月 18 日
Unfortunately it returns error as well...
Error using matlab.internal.webservices.HTTPConnector/copyContentToFile (line 412)
The server returned the status 403 with message "Forbidden" in response to the request to URL
https://www.nbp.pl/en/statystyka/m3/.
Error in websave (line 107)
copyContentToFile(connection, filename);

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

回答 (1 件)

Rik
Rik 2021 年 5 月 18 日
It seems this website blocks requests when it detects non-human requests.
You might be able to circumvent this by use the Wayback Machine. I have found that on some occasions that will work.
If you want an easy way to interact with the Wayback Machine from Matlab, you can get my WBM function from the FEX.
WBM(filename,fullURL);
  14 件のコメント
Rik
Rik 2021 年 5 月 19 日
If your IT department policy even disables reaching out to archive.org, you should ask them for suggestions.
If you have such a strict environment, why do you want to dynamically load a file from the internet anyway?
Joanna Przeworska
Joanna Przeworska 2021 年 5 月 20 日
To be honest I didn't know it was that strict. I was hoping there was a solution. Anyway, I'm really grateful for the time you took to help me.

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

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by