0
Ich habe den folgenden Code "ist ein Fehler erkannt wurde", die ich ein Codebeispiel aus dominolab verwendet:Google Trends
from pytrends.pyGTrends import pyGTrends
import time
from random import randint
from IPython.display import display
from pprint import pprint
import urllib
import sys
import os
google_username = "myusername"
google_password = "mypassword"
path = "csv_files"
if not os.path.exists(path):
os.makedirs(path)
base_keyword = "/m/0k44x" #Image Processing
terms = [
"Image Processing",
"Signal Processing",
"Computer Vision",
"Machine Learning",
"Information Retrieval",
"Data Mining"
]
advanced_terms = [
"/m/07844",
"/m/0yk6",
"/m/05kx1v",
"/m/04zv0zl",
"/m/017chx",
"/m/0cqyr9",
"/m/0121sb",
"/m/07844",
"/m/06dq9"
]
# connect to Google Trends API
connector = pyGTrends(google_username, google_password)
for label, keyword in zip(terms, advanced_terms):
print(label)
sys.stdout.flush()
keyword_string = '"{0}, {1}"'.format(keyword, base_keyword)
connector.request_report(keyword_string, geo="US", date="01/2014 65m")
# wait a random amount of time between requests to avoid bot detection
time.sleep(randint(5, 10))
# download file
connector.save_csv(path, label)
for term in terms:
data = connector.get_suggestions(term)
pprint(data)
Allerdings sehe ich diese in den gespeicherten CSV-Dateien:
<div id="report">
<div class="errorTitle">An error has been detected</div>
<div class="errorSubTitle">This page is currently unavailable. Please try again later.<br/> Please make sure your query is valid and try again.<br/> If you're experiencing long delays, consider reducing your comparison items.<br/> Thanks for your patience.</div>
</div>
Was ist schief gegangen und wie kann das behoben werden? Ich bekomme die Daten von Google Trend und hier ist .
der ursprüngliche Code war '2008 96m' – maxymoo