-1

我正在尝试使用 MATLAB 下载谷歌趋势数据。但是,当我运行以下命令时,我无法下载数据。

!"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" http://www.google.com/trends/trendsReport?q=MSFT&geo=US&content=1&export=1&graph=all_csv

但是,当我将 URL 部分粘贴到 google chrome 中时,它会下载。我怎样才能让它在 MATLAB 中工作?

4

1 回答 1

0

我假设您想要 MATLAB 中的数据。为此,最好不要对 Google Chrome 进行系统调用,而是使用 MATLAB 中集成的工具来执行此操作,例如websave.

所以你想做这样的事情:

filename = websave('filename.csv', 'http://www.google.com/trends/trendsReport?q=msft&geo=us&cmpt=q&content=1&export=1')

话虽如此,这可能有点棘手,因为谷歌可能需要身份验证才能访问该页面,因此您需要使用weboptions输入来提供必要的凭据。

于 2016-04-20T02:20:56.040 回答