以下是我访问谷歌学术时出现的两种错误:
1.We're sorry...... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now.
2.Your client does not have permission to get URL /scholar.enw?
根据作者的粗略理解,出现这两种错误的原因分别是:
第一个错误:有人使用这些公网的 IP 段来做爬虫,所以 Google 把这些公网 IP 给封了。(一般是封了ipv4,如果ipv6也被封了,那么我的方法就没用了)
第二个错误:使用该IP在短时间里在谷歌学术中下载了大量的论文。(即便是在国外,短时间内下载大量的论文,谷歌为了保护自己也会封掉他的IP)
两种错误可以使用一种方式解决:
1. 找到谷歌学术的ipv6地址并修改VPS中的hosts文件,vi /etc/hosts,在文件的最后加入以下内容
## Scholar 学术搜索
2404:6800:4008:c06::be scholar.google.com
2404:6800:4008:c06::be scholar.google.com.hk
2404:6800:4008:c06::be scholar.google.com.tw
2404:6800:4005:805::200e scholar.google.cn #www.google.cn
为了避免读者可能不了解vi,我写下具体操作(我是用xshell连接)
1.使用vi进入了hosts文件后,使用 i 进入vi编辑器的insert模式,将以上ipv6地址信息拷贝至hosts文件中。
2.用esc返回命令行模式并用:进行底行模式,最后输入wq保存并退出。
2. 然后,重启 shadowsocks /V2ray服务端程序:
1. shadowsocks:
/etc/init.d/shadowsocks restart
2. V2ray:
sudo systemctl start v2ray