-1

I am trying to download google trends data using MATLAB. However, when I run the following command, I am not able to download the data.

!"/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

However, when I paste the URL part into google chrome it will download. How can I get this to work in MATLAB?

Suever
  • 64,497
  • 14
  • 82
  • 101
xlnzw
  • 1
  • 3

1 Answers1

0

I'm assuming that you want the data in MATLAB. To do this, it is best to not make a system call to Google Chrome, but rather to use the tools integrated within MATLAB to do this such as websave.

So you'd want to do something like:

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

That being said, this may be a little tricky because Google likely requires authentication for access to that page so you would need to use the weboptions input to provide the necessary credentials.

Suever
  • 64,497
  • 14
  • 82
  • 101