所以我在上一个问题上被降级了3次,我希望我不会在这个问题上。我正在尝试编写一个解析器来解析谷歌的页面,就像这样:urllib2.urlopen("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=" + infoget)。
这是允许的吗?我似乎找不到谷歌的规则。每天/小时允许多少个请求?我赚了大约40美元,然后我就被拒绝了。
这是黑帽吗?我真的,绝对不想在这里成为黑帽-我试图写出可接受的,好的代码。
发布于 2012-06-19 20:43:00
https://developers.google.com/custom-search/v1/overview?hl=en
Free quota
Usage is free for all users, up to 100 queries per day.发布于 2018-02-24 06:04:17
我们有一个Python库来获取和解析谷歌搜索结果,可以在这里访问:https://github.com/serpapi/google-search-results-python
from lib.google_search_results import GoogleSearchResults
query = GoogleSearchResults({"q": "coffee"})
html_results = query.get_html()它现在只支持SerpApi.com后端,但请随意扩展它以支持更多的后端。
更全面的选项:
query_params = {
"q": "query",
"google_domain": "Google Domain",
"location": "Location Requested",
"device": device,
"hl": "Google UI Language",
"gl": "Google Country",
"safe": "Safe Search Flag",
"num": "Number of Results",
"start": "Pagination Offset",
"serp_api_key": "Your SERP API Key"
}
query = GoogleSearchResults(query_params)
query.params_dict["location"] = "Portland"
html_results = query.get_html()
dictionary_results = query.get_dictionary()
dictionary_results_with_images = query.get_dictionary_with_images()
json_results = query.get_json()
json_results_with_images = query.get_json_with_images()https://stackoverflow.com/questions/11101044
复制相似问题