使用脚本语言提取源代码

编码器

我正在尝试提取网站的源代码。我在脚本文件中这样编码:

curl http://www.example.com

输出为:

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

只是这个!我无法获取完整的代码。但为什么?我应该使用其他命令(如果有)吗?

我想获取网站的源代码(我的意思是html),但我只看到几行...

雨果

您应该-L按照此处所述使用选项“跟随重定向” ,当然也可以在man curl上使用

curl -L http://www.example.com

也许甚至足以使用

curl https://www.example.com

因为它在这里说301响应的最常见原因是该页面以前从http到的迁移https

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章