谷歌搜索方法

  因为平时需要看一些技术性的资料,所以有时候需要使用谷歌搜索,个人比较喜欢google搜索英文版。
  今天在换了一个VPN后使用谷歌,竟然使用的是其他语言,想用谷歌英文版和谷歌中文版,最后在网上找到了答案。
  http://www.google.com/ncr 谷歌搜索
  http://www.google.com/webhp?hl=en&gl=us 谷歌搜索英文版

(1) 谷歌搜索使用指定语言

google隐藏了一个秘密,你想看英文版而不被跳转,请使用谷歌浏览器输入
http://www.google.com/ncr
http://www.google.com/webhp?hl=en&gl=us

https://www.google.com/ncr
https://www.google.com/webhp?hl=en&gl=us
https://www.google.com.hk/webhp?hl=zh-CN&sourceid=cnhp&gws_rd=ssl

道理很简单:ncr后缀是no country redirect的英文缩写,在网址中指定了这个要求后,
谷歌就自动屏蔽了根据IP定位当地站点的功能,而直接指向了美国谷歌站。

(2) 谷歌是如何判断搜索语言的

  1. 根据http请求里的”Accept-Language”: “zh-CN,zh;q=0.9,zh-TW;q=0.8”
  2. 谷歌有你所登录的账号的设置与当前文本所属语言
  3. ip地址 根据ip辅助判断
  4. 谷歌维护了词表,触发Query Rewrite
{
    "args": {},
    "headers": {
        "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
        "Accept-Encoding": "gzip, deflate, br",
        "Accept-Language": "zh-CN,zh;q=0.9,zh-TW;q=0.8",
        "Host": "httpbin.org",
        "Sec-Fetch-Mode": "navigate",
        "Sec-Fetch-Site": "none",
        "Sec-Fetch-User": "?1",
        "Upgrade-Insecure-Requests": "1",
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36"
    },
    "origin": "106.38.115.25, 106.38.115.25",
    "url": "https://httpbin.org/get"
}
{
    "args": {},
    "headers": {
        "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
        "Accept-Encoding": "gzip, deflate, br",
        "Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
        "Host": "httpbin.org",
        "Upgrade-Insecure-Requests": "1",
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:70.0) Gecko/20100101 Firefox/70.0"
    },
    "origin": "106.38.115.25, 106.38.115.25",
    "url": "https://httpbin.org/get"
}
{
    "args": {},
    "headers": {
        "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
        "Accept-Encoding": "br, gzip, deflate",
        "Accept-Language": "en-us",
        "Host": "httpbin.org",
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15"
    },
    "origin": "106.38.115.25, 106.38.115.25",
    "url": "https://httpbin.org/get"
}

(3) 被墙时的临时办法

谷歌学术搜索 http://scholar.hedasudi.com/
代理 https://ww.tw.53yu.com/
代理 https://guge.hk.bban.fun/

References

[1] 谷歌无限制搜索方法
[2] 谷歌是如何判断搜索语言的?