Skip to content
This repository has been archived by the owner on Sep 10, 2023. It is now read-only.

feat: 支持 cn.bing.com #463

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

AllanChain
Copy link

Closes #431

Copy link
Owner

@axetroy axetroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么这么奇怪,为打开的 bing 没有什么重定向连接,所以我测试不出来

@AllanChain
Copy link
Author

哦对,要切换成国际版才有。但是国际版和国内版在 URL 不一定体现得出来 😂

那这个网址可以吗?加参数强制国际版: https://cn.bing.com/search?q=GitHub&ensearch=1

要是能测试出来的话我把测试地址改一下

@axetroy
Copy link
Owner

axetroy commented Jun 29, 2021

哦对,要切换成国际版才有。但是国际版和国内版在 URL 不一定体现得出来 😂

那这个网址可以吗?加参数强制国际版: cn.bing.com/search?q=GitHub&ensearch=1

要是能测试出来的话我把测试地址改一下

依旧无法重现,换了浏览器也不行

@AllanChain
Copy link
Author

很奇怪,我刚刚又回头看了一下 @shenzhiming88 的录屏,发现他用的是必应国内版,也被重定向。但是我也开了隐私窗口,用国内版就是没有重定向,而用国际版却有重定向,国际版的表现和录屏一致。然后换浏览器,火狐和 Edge 表现一致,Chrome 则没有被重定向。难道是必应对不同环境有不同表现?

@DeepChirp
Copy link

@AllanChain 好奇怪,我这边偶尔会重定向,但是频率非常低

@AllanChain
Copy link
Author

必应确实会根据 UA 和 Cookie 等请求头返回不同的 HTML。如果我直接不加 cookie:

❯ curl 'https://cn.bing.com/search?q=github&ensearch=1' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0' > firefox_clean.html
❯ curl 'https://cn.bing.com/search?q=github&ensearch=1' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' > chrome_clean.html

可以看到 firefox_clean.html 里有这样一部分,但 chrome_clean.html 里却找不到:

u="/newtabredir?url="+encodeURIComponent(i);f&&(u=u+"&be=1");_w.open(u,"_blank");

体现出来就是 Firefox 有这么一个事件:

Firefox Screenshot

但是按照必应的脾气返回的 HTML 可能还和 IP 等因素有关,如果真是这样那也很难测试了。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

支持网站: 必应搜索
3 participants