我在C#中編寫了一個工具,將搜索結果返回到Google搜索。但是,即使我關閉了cookies並刪除了瀏覽器歷史記錄。它仍然會返回我當地的搜索結果:芝加哥。我使用的URL是:Google機器人搜索返回本地結果
URL =「https://www.google.com/search?q=health和美容&即= UTF-8 & OE = UTF-8 &水溶液=噸& RLS = org.mozilla:EN-US:官方&客戶端= firefox的-A &開始= 0 & NUM = 9 & GL =我們」
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Accept = "application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
request.Headers["Accept-Language"] = "en-US";
//request.UserAgent = "Mozilla/6.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/16.0.2";
request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
request.KeepAlive = true;
request.AllowAutoRedirect =true;
request.Timeout = 60000;
request.Method = "GET";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
{
Stream responseStream = response.GetResponseStream();
StreamReader myStreamReader = new StreamReader(responseStream);
responseData = myStreamReader.ReadToEnd();
}
response.Close();
內的工具,它不斷給我芝加哥的結果。我有沒有辦法讓美國的結果取代芝加哥?
我認爲這是一個Google問題,而不是編程問題。您需要從Google論壇尋求幫助。 (破壞者警報:我做了一個快速搜索,發現沒有解決方案,只是很多人抱怨) –