中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-08 21:14
47,811 主题排行 / 349,895 发帖 / 今日 0 篇 / 48,253 会员排行
DOS批处理 & 脚本技术(批处理室) » [原创]批量智能下载网页图片[抛砖]
可打印版本  4,192 / 23
第16楼 ngd 发表于 2008-03-17 00:48
中级用户 发帖 108 积分 312
curl和sed的问题

curl: (3) illegal character in range specification at pos 132
总感觉curl在某些方面有很多缺陷,为何出现这样的情况?
有时 url中 有 & 字符时必需使用在 & 前加转义字符,而有些时候却不需要,为何?




这2个命令执行的结果为何不一样?
第17楼 junchen2 发表于 2008-03-17 13:53
高级用户 发帖 219 积分 537 来自 杭州--半山
总感觉curl在某些方面有很多缺陷,为何出现这样的情况?
有时 url中 有 & 字符时必需使用在 & 前加转义字符,而有些时候却不需要,为何?
--------------------------
1我想应该跟CMD.EXE语法分析有关,cmd碰到&它认为是一个语句的结束。


这2个命令执行的结果为何不一样?
--------------------------------------------
2。sed 是以行为单位进行读取数据的。大概过程是提取curl里的一行数据读取后的内容存放在pattern space。经过 sed "s/\x22/\xa/g" 处理后,貌似生成了多行,实际上它仍然存储在pattern space,作为一个未加工完的半成品,/baidump3/!d 再对其进行处理。
反正记住
sed对它输入的数据是采取一行行读的,输入可能是以管道,文件,进程中的通信等方式。
pattern space的内容是不会以 输入 那样对待的。

[ Last edited by junchen2 on 2008-3-17 at 01:54 PM ]
第18楼 vkill 发表于 2008-03-18 16:24
金牌会员 发帖 1,744 积分 4,103 来自 甘肃.临泽
像from提交的网页用 wget 和 curl 都可以解决,两个都试下就好了
第19楼 knoppix7 发表于 2008-03-18 19:02
银牌会员 发帖 634 积分 1,287 来自 cmd.exe
D:\>wget "http://mp3.baidu.com/u?u=http://www.yantaiblog.net/UploadFiles/2007-7/
aGhmbGtmbGsx.mp3"
--17:52:54-- http://mp3.baidu.com/u?u=http://www.yantaiblog.net/UploadFiles/200
7-7/aGhmbGtmbGsx.mp3
=> `u@u=http:%2F%2Fwww.yantaiblog.net%2FUploadFiles%2F2007-7%2FaGhmbG
tmbGsx.mp3'
Resolving mp3.baidu.com... done.
Connecting to mp3.baidu.com:80... connected.
HTTP request sent, awaiting response... 302 Object moved
Location: http://www.yantaiblog.net/UploadFiles/2007-7/76386053.mp3
--17:52:55-- http://www.yantaiblog.net/UploadFiles/2007-7/76386053.mp3
=> `76386053.mp3'
Resolving www.yantaiblog.net... done.
Connecting to www.yantaiblog.net:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4,505,113

0% 19,433 9.56K/s ETA 07:38
第20楼 zerocq 发表于 2008-03-18 19:12
中级用户 发帖 196 积分 458
楼主能否解释一下curl的keepalive选项该在什么情况下使用,如何使用

谢谢
第21楼 ngd 发表于 2008-03-18 21:07
中级用户 发帖 108 积分 312
Originally posted by zerocq at 2008-3-18 19:12:
楼主能否解释一下curl的keepalive选项该在什么情况下使用,如何使用

谢谢

没用过 keepalive方式的
参考
http://curl.haxx.se/docs/manpage.html

--keepalive-time <seconds>

This option sets the time a connection needs to remain idle before sending keepalive probes and the time between individual keepalive probes. It is currently effective on operating systems offering the TCP_KEEPIDLE and TCP_KEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more). This option has no effect if --no-keepalive is used. (Added in 7.18.0)

If this option is used multiple times, the last occurrence sets the amount.

[ Last edited by ngd on 2008-4-19 at 05:15 PM ]
第22楼 ngd 发表于 2008-03-18 21:46
中级用户 发帖 108 积分 312
Originally posted by knoppix7 at 2008-3-18 19:02:
D:\>wget "http://mp3.baidu.com/u?u=http://www.yantaiblog.net/UploadFiles/2007-7/
aGhmbGtmbGsx.mp3"
--17:52:54-- http://mp3.baidu.com/u?u=http://www.yantaiblog.net/UploadFiles/2 ... 奇怪!wget 1.10.2 D:\>wget "http://mp3.baidu.com/u?u=http://www.yantaiblog.net/UploadFiles/2007-7/ aGhmbGtmbGsx.mp3" --20:32:27-- http://mp3.baidu.com/u?u=http://www.yantaiblog.net/UploadFiles/200 7-7/aGhmbGtmbGsx.mp3 => `u@u=http%3A%2F%2Fwww.yantaiblog.net%2FUploadFiles%2F2007-7%2FaGhm bGtmbGsx.mp3' Resolving mp3.baidu.com... 220.181.38.70 Connecting to mp3.baidu.com|220.181.38.70|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://www.baidu.com/search/error.html --20:32:28-- http://www.baidu.com/search/error.html => `error.html' Resolving www.baidu.com... 220.181.6.6, 220.181.37.55 Connecting to www.baidu.com|220.181.6.6|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2,699 (2.6K) 100% 2,699 --.--K/s 20:32:38 (52.95 MB/s) - `error.html' saved
第23楼 knoppix7 发表于 2008-03-19 19:41
银牌会员 发帖 634 积分 1,287 来自 cmd.exe
D:\>wget --help
GNU Wget 1.8.2, a non-interactive network retriever.
第24楼 kioskboy 发表于 2008-08-08 11:38
初级用户 发帖 103 积分 153
curl -d "UserName=***&Password=******" http://www.netyi.net/jsLoginStatus.aspx
怎么登陆不了
上一页  1 2
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023