मैं Matlab login and download failure when calling WebClient.DownloadFile पर पोस्ट किए गए मूल कोड से काम कर रहा हूं ताकि मैटलैब से सीधे सीएसवी में Google ट्रेंड डेटा को डाउनलोड और डाउनलोड किया जा सके।matlab डाउनलोड google trends csv
मैं भी login with curl and get session पर इमानुएल के पोस्ट में पढ़ा कि गूगल के प्रमाणीकरण नीति बदल गया है, और अब मेरी कोड इस तरह दिखता है:
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)
जो unforgivingly रिटर्न:
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>
तो किसी को भी करने में सक्षम है matlab से Google Trends csv डेटा तक पहुंचें, आप मेरे हीरो