使用wget和curl进行奇怪的网页下载

时间:2010-09-09 14:09:02

标签: curl wget

我正在尝试下载一些远程页面。在源代码中有一个很长的行。卷曲和wget都下载文件,但决定错过这一行。是否有我可以使用的其他命令行实用程序和/或是否有人知道如何解决此问题。

编辑: 我可以澄清一下,我尝试过wget和curl,两个文件都错过了这条线。

编辑:

[x@x scripts]$ curl --version
curl 7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Protocols: tftp ftp telnet dict ldap http file https ftps 
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz 
[x@x scripts]$ wget --version
GNU Wget 1.11.4 Red Hat modified

Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Originally written by Hrvoje Niksic <hniksic@xemacs.org>.
Currently maintained by Micah Cowan <micah@cowan.name>.

3 个答案:

答案 0 :(得分:1)

对于正在发生的事情,有两种可能的解释:

  1. 服务器查看用户代理并决定不包含此行。这两者的可能性较小,但wget允许您更改用户代理字符串,因此您应该能够轻松解决它。
  2. 使用JavaScript在客户端上构建长行。这很可能,但不幸的是,在命令行环境中不容易复制。
  3. 要进行验证,请使用Fiddler之类的工具查看实际传输的内容。

答案 1 :(得分:0)

写wget / curl的版本。那条线的长度是多少?

答案 2 :(得分:-2)

为什么不使用curl wget?两者都是很好的工具!

相关问题