简体   繁体   English

在ttp://toolbarqueries.google.com/search?q = info :(域名)上获取“远程服务器返回错误:(503)服务器不可用”

[英]Getting “The remote server returned an error: (503) Server Unavailable” on ttp://toolbarqueries.google.com/search?q=info:(domainName)

I am trying to create a windows service. 我正在尝试创建Windows服务。 The purpose of service is to pick up urls from a database and check their page rank from google. 服务的目的是从数据库中获取URL,并从Google检查其页面排名。 The purpose is to catch any one faking their page ranks. 目的是捕获任何伪造其页面排名的人。 I found some code at http://www.codeproject.com/KB/aspnet/Google_Pagerank.aspx and used it. 我在http://www.codeproject.com/KB/aspnet/Google_Pagerank.aspx中找到了一些代码并使用了它。

Now here is the code 现在这是代码

  public static int GetPageRank()
    {

        string file = "http://toolbarqueries.google.com/search?q=info:codeproject.com";
        try
        {
            //Request PR from Google



            WebRequest request = WebRequest.Create(file);
            WebResponse response = request.GetResponse();

            StreamReader reader = new StreamReader(response.GetResponseStream());
            string data = reader.ReadToEnd();

            reader.Close();
            response.Close();

            //Parse PR from string
            int pageRank = -1;
            if (data.IndexOf(':') != -1)
            {
                data = data.Substring(data.LastIndexOf(':') + 1);
            }

            int.TryParse(data, out pageRank);

            return pageRank;
        }
        catch (Exception ex)
        {

            MessageBox.Show(ex.Message);
            return -1;
        }
    }

Now what is happening is this when this method is called after some tries like 100 tries i start getting following exception. 现在发生了什么事,当像100次尝试之后我调用此方法时,我开始出现以下异常。 "The remote server returned an error: (503) Server Unavailable". “远程服务器返回错误:(503)服务器不可用”。 I have done some research and i have seen a related question on stack overflow as well. 我做了一些研究,也看到了有关堆栈溢出的一个相关问题。 Apparently google stops serving requests if to many of them originate from a same ip. 显然,如果许多请求来自同一ip,则google会停止提供请求。 Are there any work arounds to it that will enable me to check several thousand pageranks in say two hours or three hours. 是否有任何变通办法,使我可以在两个小时或三个小时内检查几千个页面排名。

Are there any work arounds to it that will enable me to check several thousand pageranks in say two hours or three hours[?] 是否有任何变通办法,使我可以在两个小时或三个小时内检查几千个页面排名[?]

Nope. 不。 You're simply requesting too much data. 您只是在请求太多数据。 There might be a JSON or XML API to get batch responses, but I am not aware of any from Google. 可能会有JSON或XML API来获取批处理响应,但是我不知道来自Google的任何信息。

Finally what we did was get proxies from a proxy provider and use them. 最后,我们所做的是从代理提供者那里获取代理并使用它们。 Had to use a semaphore so that all the threads would be assigned a new proxy while ensuring that a proxy is not used more that 3 times a minute and proxies are rotated in circular sequential manner. 必须使用信号量,以便为所有线程分配一个新的代理,同时确保代理每分钟不被使用超过3次,并且代理以循环顺序的方式旋转。 There is no other work around to this. 没有其他解决方法。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 远程服务器返回错误:(503)服务器不可用。 在谷歌翻译 - The remote server returned an error: (503) Server Unavailable. in Google Translator 来自WebClient的错误:“远程服务器返回错误:(503)服务器不可用” - Error from WebClient: “The remote server returned an error: (503) Server Unavailable” 使用Google.GData.Apps的异常:远程服务器返回错误:(503)服务器不可用 - Exception using Google.GData.Apps : The remote server returned an error: (503) Server Unavailable Whille检查http状态代码得到错误提示-远程服务器返回错误:(503)服务器不可用 - whille checking http status code getting error saying - The remote server returned an error: (503) Server Unavailable WCF:远程服务器返回错误:“(417)预期失败”和“(503)服务器不可用” - WCF: The remote server returned an error: '(417) Expectation Failed' and '(503) Server Unavailable' HttpWebRequest错误:503服务器不可用 - HttpWebRequest Error: 503 server unavailable HttpListener服务器返回错误:(503)服务不可用 - HttpListener server returns an error: (503) Service Unavailable 如何克服 503 服务器不可用错误? - How to overcome from 503 Server unavailable error? 远程服务器返回错误 - The remote server returned an error 多语言Google Translate API正在退回(503)服务器不可用 - Multi-language Google Translate API is returing (503) Server Unavailable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM