【问题标题】:How to get curl to return actual website data如何让 curl 返回实际的网站数据
【发布时间】:2019-12-01 16:24:44
【问题描述】:

当我使用浏览器访问 thelibertydaily.com 时,站点信息会完整显示。当我使用 curl 获取信息时,我只得到这个:

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

谁能告诉我如何使用 curl 从网站获取真实信息?

谢谢

【问题讨论】:

标签: curl libcurl


【解决方案1】:

如果你执行curl --helpcurl 的所有选项都将返回。您感兴趣的是:

-L, --location      Follow redirects (H)

所以,执行你的命令:

curl -L url

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-21
    • 1970-01-01
    • 1970-01-01
    • 2019-04-07
    • 2013-03-17
    • 2012-09-07
    相关资源
    最近更新 更多