如果同时存在&& a.html两者,则将wget替换下载的密钥

时间:2019-02-08 15:03:42

标签: wget

设置带有3个文件的简单静态http服务器。假设主机为http://127.0.0.1:8082

  • a && a.html,其内容包含指向b
  • 的链接
<body>
    <a href="b"></a>
</body>
  • b,其中包含2个指向相同名称url但后缀不同的链接。
<body>
    <a href="a"></a>
    <a href="a.html"></a>
</body>

我尝试使用wget -E -m -p -k http://127.0.0.1:8082/a,并且期望b中的两个链接都将转换为相对路径。但实际上,结果是,

<body>
    <a href="http://127.0.0.1:8082/a"></a>
    <a href="a.html"></a>
</body>

我猜想wget将&& a.html视为同一文件(与-E相同)。转换b中的链接时,存在的a被误认为未下载,因为a.html覆盖了已下载的密钥。


[zhong@localhost wget]$ wget -E -m -p -k http://127.0.0.1:8082/a
- 2019-02-09 20:58:42 -- http://127.0.0.1:8082/a
Connecting 127.0.0.1:8082... Connected.
HTTP request has been issued, waiting for response... 200 OK
Length: 35 [text/html]
Save to "127.0.0.1:8082/a.html"

127.0.0.1:8082/a.html 100%[=========================>] 35 - - KB/s takes 0s

2019-02-09 20:58:42 (4.17 MB/s) - Preserved "127.0.0.1:8082/a.html" [35/35])

Robots.txt is being loaded; please ignore the error message.
- 2019-02-09 20:58:42 -- http://127.0.0.1:8082/robots.txt
Reuse existing connections to 127.0.0.1:8082.
An HTTP request has been issued and is awaiting a response... 404 Not Found

2019-02-09 20:58:42 Error 404: Not Found.
Conversion from UTF-8 to UTF-8 is not supported
- 2019-02-09 20:58:42 -- http://127.0.0.1:8082/b
Reuse existing connections to 127.0.0.1:8082.
HTTP request has been issued, waiting for response... 200 OK
Length: 61 [text/html]
Save to "127.0.0.1:8082/b.html"

127.0.0.1:8082/b.html 100%[=========================>] 61 - - KB/s takes 0s

2019-02-09 20:58:42 (7.27 MB/s) - Preserved "127.0.0.1:8082/b.html" [61/61])
Conversion from UTF-8 to UTF-8 is not supported

- 2019-02-09 20:58:42 -- http://127.0.0.1:8082/a.html
Reuse existing connections to 127.0.0.1:8082.
HTTP request has been issued, waiting for response... 200 OK
Length: 35 [text/html]
Save to "127.0.0.1:8082/a.html"

127.0.0.1:8082/a.html 100%[=========================>] 35 - - KB/s takes 0s

2019-02-09 20:58:42 (2.78 MB/s) - Preserved "127.0.0.1:8082/a.html" [35/35])

Download completed -- 2019-02-09 20:58:42--
Total time: 0.009s
Downloaded: 3 files, 131 in 0s (4.46 MB/s)
Links in 127.0.0.1:8082/a.html are being converted... 1-0
Links in 127.0.0.1:8082/b.html are being converted... 1-1
Links in two files have been converted in 0.001 seconds

0 个答案:

没有答案