【发布时间】:2017-06-18 01:42:58
【问题描述】:
我正在尝试通过 curl/wget 检索网站,但我看到的不是浏览器中看到的真实内容,而是 ESI 标记。
网址是http://www.patagonia.com/home/?setCountryCode=US&setLocaleCode=en_US&setLocaleCodeSelect=en
<html xmlns="http://www.w3.org/1999/xhtml" class="no-js" lang="en"><head/><body onload="submitWait();true;"><esiU00003Aremove>
</esiU00003Aremove>
<esiU00003Acomment text=" ------------- begin html ---------- ">
<esiU00003Acomment text=" --- CUSTOMIZE HEAD HERE --- ">
<meta charset="utf-8"/> <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/>
<title>Hang Tight! Routing to checkout...</title> ......
我已经通过邮递员尝试过,只发送 Accept 和 Connection cookie,我看到了正常的 HTML 结果。我不太确定发生了什么。有没有人知道要发送什么标头或要为 wget/curl 做些什么来正确获取页面?
【问题讨论】:
-
如果你get Postman to generate the CURL request for you会发生什么?然后它会显示 ESI 标签吗?
-
@ʰᵈˑ有趣的想法,试过了,也不行,它生成了
curl -X GET -H "Cache-Control: no-cache" -H "Postman-Token: 3f7093a7-c0f0-4675-edf9-12e0659d17c8" "http://www.patagonia.com/home/?setCountryCode=US&setLocaleCode=en_US&setLocaleCodeSelect=en"
标签: curl web-crawler wget edge-side-includes