因为它是HTML meta tag redirect,并且 curl 不支持自动跟随 HTML 元标记重定向。要遵循你需要理解 HTML 的东西,curl 不需要。
quotes.money.163.com/f10/gszl_600024.html包含html标签<meta http-equiv="refresh" content="5; url=/">告诉浏览器after 5 seconds, redirect to the root of this domain是quotes.money.163.com/,quotes.money.163.com/依次从http://img1.cache.netease.com/f2e/finance/backend_project/quotes_index_2014/app/dist/js/quotes_hub.916069.min.js加载javascript,其中包含
! function(o) {
var l = location.href,
t = !!location.hash.split("#")[1] ? location.hash.split("#")[1] : "HS",
c = location.host,
n = location.protocol,
i = {
HS: "stock",
US: "usstock",
HK: "hkstock",
BOND: "bond",
FX: "old/#FX",
FN: "old/#FN",
FU: "old/#FU",
GB: "old/#GB",
DC: "old/#DC"
},
e = i[t],
a = n + "//" + c + "/stock";
function s() {
return l.indexOf("quotes.money.163.com/old/") > -1 ? 1 : 0
}
function r(o) {
return o.indexOf("query") > -1 ? 1 : 0
}
if (!s()) {
if (e) {
location.replace(n + "//" + c + "/" + e)
} else {
if (r(t)) {
location.replace(n + "//" + c + "/old/#" + t)
} else {
location.replace(a)
}
}
}
}(this);
通过修改 window.location 将 javascript 重定向到 http://quotes.money.163.com/stock,更糟糕的是,curl 既不理解 javascript 重定向也不理解 html 重定向。如果您想要理解这两者的东西,请考虑使用无头浏览器。