5
私はMatlab login and download failure when calling WebClient.DownloadFileに掲載された元のコードから、matlabから直接csvでGoogleトレンドデータをダウンロードしようとしています。matlab download google trends csv
私はまた、Googleの認証ポリシーが変更されたことをlogin with curl and get sessionでエマヌエーレの記事で読んで、そして今、私のコードは次のようになります。誰もができる場合
ans =
<div id="report">
<div class="timeBandTitle">An error has been detected</div>
<div class="timeBandSubTitle">You have reached your quota limit. Please try again later.</div>
</div>
:どのunforgivingly戻り
NET.addAssembly('System.Net');
url = strcat(['https://www.google.com/accounts/ClientLogin?accountType=GOOGLE&Email=' USERNAME '&Passwd=' PASSWORD '&service=trendspro&source=test-test-v1']);
durl = System.String(strcat('http://www.google.com/trends/viz?q=', keyWord, '&date=all&geo=all&graph=all_csv&sort=0&scale=1&sa=N'))
if exist('googleWebClient','var')
client = googleWebClient;
else
client = System.Net.WebClient;
response = client.DownloadString(url);
sid = char(response.ToString);
sid = regexp(sid, '\n', 'split');
client.Headers.Add('Cookies', char(sid(1)));
client.Headers.Add('Authorization', strcat( 'GoogleLogin ' , char(sid(3)) ) );
end
client.DownloadString(durl)
あなたは私のヒーローです。