0
내가 구글 (
https://www.google.ie/trends/fetchComponent?hl=en-AU&q=boston%20celtics&date=now%201-d&cmpt=q&tz=Etc%2FGMT-1&tz=Etc%2FGMT-1&content=1&cid=RISING_ENTITIES_0_0&cat=0-20)에서 데이터를 크롤링하고 몇 번 시도 후, 나는 가지고하려고
import urllib
def getUrl():
url = 'https://www.google.ie/trends/fetchComponent?hl=en-AU&q=boston%20celtics&date=now%201-d&cmpt=q&tz=Etc%2FGMT-1&tz=Etc%2FGMT-1&content=1&cid=RISING_ENTITIES_0_0&cat=0-20'
headers = {}
headers['User-Agent'] = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17"
req = urllib.request.Request(url, headers = headers)
resp = urllib.request.urlopen(req)
respData = resp.read().decode('utf-8')
print(respData)
print('......................................................')
timeframe = {'day':'d','week':'w'}
team=['boston celtics','Houston Rockets','Cleveland Cavaliers','Golden State Warriors']
for i in team:
getUrl(i,timeframe['day'])
'당신은 당신의 할당량 한도에 도달했습니다. 나중에 다시 시도하십시오 ' 문제를 해결할 수있는 방법이 있습니까?python urllib.requst '할당량 제한에 도달했습니다. 나중에 다시 시도하십시오 '구글 동향에
http://stackoverflow.com/questions/17393969/google-trends-quota-limit – Kush131
중복이 가능하고 데이터를 크롤링하면 작동합니다. 참고 : https : //github.com/GeneralMills/pytrends/blob /master/pytrends/pyGTrends.py. _connect and_init_는 Google에 로그인하는 방법을 보여줍니다. –