【发布时间】:2020-09-16 08:52:27
【问题描述】:
https://psycnet.apa.org/record/2016-47119-002
当我通过 chrome(在私人窗口中)访问上述 URL 时,我可以看到与以下 curl 命令相对应的第一个请求。但是当我在命令行中调用这个curl命令时,distil网络会检测到它显示<div id="distilIdentificationBlock"> </div>
。
这对我来说看起来很奇怪,因为这是第一个请求。除非 curl 和 chrome 发送的请求之间存在差异,否则 distil 网络无法判断机器人或真实浏览器发送的请求是什么。有人知道 curl 请求和 chrome 请求有什么区别吗?
curl 'https://psycnet.apa.org/record/2016-47119-002' \
-H 'Connection: keep-alive' \
-H 'Pragma: no-cache' \
-H 'Cache-Control: no-cache' \
-H 'Upgrade-Insecure-Requests: 1' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \
-H 'Sec-Fetch-Site: none' \
-H 'Sec-Fetch-Mode: navigate' \
-H 'Sec-Fetch-User: ?1' \
-H 'Sec-Fetch-Dest: document' \
-H 'Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7' \
--compressed
附:如果我使用firefox提取相应的curl命令,问题是一样的。所以firefox请求和curl请求的区别也有关系。
【问题讨论】:
-
这个问题应该重命名为“与 Chrome 请求相比,Distill 如何检测和阻止 curl 请求?”
-
请根据需要进行更改。
标签: javascript google-chrome http curl firefox