2010-07-26 45 views

回答

2

看看Alex Martelli's example

如果您搜索「汽車」之類的模糊內容,data將如下所示。注意它不是很長;您只能獲得排名前幾位的點擊數,並可鏈接到「moreResultsUrl」。因此,進行此查詢的速度應該相當快,並在 data['cursor']['estimatedResultCount']中查看估計的點擊次數。

{'cursor': {'currentPageIndex': 0, 
      'estimatedResultCount': '168000000', 
      'moreResultsUrl': 'http://www.google.com/search?oe=utf8&ie=utf8&source=uds&start=0&hl=en&q=cars', 
      'pages': [{'label': 1, 'start': '0'}, 
         {'label': 2, 'start': '4'}, 
         {'label': 3, 'start': '8'}, 
         {'label': 4, 'start': '12'}, 
         {'label': 5, 'start': '16'}, 
         {'label': 6, 'start': '20'}, 
         {'label': 7, 'start': '24'}, 
         {'label': 8, 'start': '28'}]}, 
'results': [ <<list of 4 dicts>> ]} 
相關問題