我用 C# 编写了一个在 Google 搜索中返回搜索结果的工具。但是,即使我关闭了 cookie 并删除了浏览器历史记录。它仍然返回我当地的搜索结果:芝加哥。我使用的网址是:
URL = "https://www.google.com/search?q=health and beauty&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&start=0&num=9&gl=us "
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();
在该工具中,它不断为我提供芝加哥的结果。有没有办法让我得到美国而不是芝加哥的结果?