Google商家信息搜索动态数据加载

时间:2014-09-04 21:45:08

标签: google-maps web web-scraping google-places

您好我正在尝试搜索Google地方信息并且基本结构很好: https://plus.google.com/local/Leeds,%20United%20Kingdom/s/car%20rental

但是要加载其他数据,请向下滚动页面。我使用fiddler检查请求但无法确定发布的数据来自何处?

有人知道如何在第2/3页上简单加载或启动。甚至可以同时加载10个以上的moare。

1 个答案:

答案 0 :(得分:1)

这将从30加载到40,它以我无法识别的格式响应,但它可以满足您的需求。如果您需要进一步的帮助,您必须更具体。偏移量是查询的偏移量,因此30从30变为40,100从100变为110等。

import sys
reload(sys)
sys.setdefaultencoding("utf-8")

import requests

url = "https://plus.google.com/_/local/searchresultsonly"

offset = "30"

data = {
    "f.req": '[[[],[],"car rental","Leeds, United Kingdom",[],["Leeds, West Yorkshire, UK",[0,0,0,0]],null,0],[{}]]'.format(offset),
}

print requests.post(url, data).text