Python:查找公司列表的网站

2024-03-29 12:44:27 发布

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

我尝试使用下面的python代码来查找这些公司的网站。但是在尝试了几次之后,我遇到了一个服务不可用错误。在

我已经完成了寻找公司可能领域的第一层。例如:

公司示例[u'http://www.examples.com/',u'https://www.example.com/quote/CGL:SP',u'http://example2.sgx.com/FileOpen/China%20Great%20Land.ashx?App=Prospectus&FileID=3813',u'https://www.example3.com/php/company-profile/SG/en_2036109.html']

from google import search
for link in links:
    parsed_uri = urlparse(link)
    domain = '{uri.scheme}://{uri.netloc}/'.format(uri=parsed_uri)
    for url in search(domain,stop = 4):
         print url

请帮助我:

  1. 为什么突然发现urllib2.HTTPError:HTTP Error 503:Service Unavailable错误。在
  2. 是否有其他方法(Python请求)来查找公司列表的网站?在

Tags: inhttpscomhttpurlforsearch网站
1条回答
网友
1楼 · 发布于 2024-03-29 12:44:27

googleapi通常对非付费用户是有费率限制的。超过你的极限可能是导致503人回答的原因。根据API documentation你每天可以获得100个免费搜索,之后每1000个查询5美元,最多10000个查询:

Custom Search Engine (free)

For CSE users, the API provides 100 search queries per day for free. If you need more, you may sign up for billing in the API Console. Additional requests cost $5 per 1000 queries, up to 10k queries per day.

相关问题 更多 >