在进行Google-SERP解析时如何避免成为黑帽子

2024-05-17 18:01:12 发布

您现在位置:Python中文网/ 问答频道 /正文

所以我在最后一个问题上被降级了三次,我希望我不会在这个问题上。我试图编写一个解析器来解析Google的页面,比如:urllib2.urlopen("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=" + infoget)。在

允许这样吗?我似乎找不到谷歌的规则。每天/小时允许多少个请求?我赚了大约40英镑,然后就被拒绝了。在

这是黑帽子吗?我真的,绝对不是想在这里成为一个黑帽子——我想写一些可以接受的好代码。在


Tags: comwebhttp解析器searchservicegoogleajax
2条回答

https://developers.google.com/custom-search/v1/overview?hl=en

Free quota
Usage is free for all users, up to 100 queries per day.

我们有一个Python库来获取和解析Google搜索结果,可以在这里访问: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网站后端现在,但请随意扩展它支持更多的后端。在

更全面的选择:

^{pr2}$

相关问题 更多 >