我在fedora 23中学习wget实用程序。在wget的许多使用中,我收到相同的错误。 例如,我测试的命令之一是:
wget ‐‐output-file=logfile.txt ‐‐recursive ‐‐spider http://www.howtogeek.com/
但我明白了:
idn_encode failed (3): ‘Non-digit/letter/hyphen in input’
--2016-06-17 16:40:09-- http://%E2%80%90%E2%80%90output-file=logfile.txt/
Resolving ‐‐output-file=logfile.txt (‐‐output-file=logfile.txt)... failed: No address associated with hostname.
wget: unable to resolve host address ‘‐‐output-file=logfile.txt’
idn_encode failed (3): ‘Non-digit/letter/hyphen in input’
--2016-06-17 16:40:10-- http://%E2%80%90%E2%80%90output-file=logfile.txt/
Resolving ‐‐output-file=logfile.txt (‐‐output-file=logfile.txt)... failed: No address associated with hostname.
wget: unable to resolve host address ‘‐‐output-file=logfile.txt’
--2016-06-17 16:40:11-- http://xn--recursive-u79da/
Resolving ‐‐recursive (xn--recursive-u79da)... failed: No address associated with hostname.
wget: unable to resolve host address ‘xn--recursive-u79da’
--2016-06-17 16:40:17-- http://xn--recursive-u79da/
Resolving ‐‐recursive (xn--recursive-u79da)... failed: No address associated with hostname.
wget: unable to resolve host address ‘xn--recursive-u79da’
--2016-06-17 16:40:18-- http://xn--spider-9f0ca/
Resolving ‐‐spider (xn--spider-9f0ca)... failed: No address associated with hostname.
wget: unable to resolve host address ‘xn--spider-9f0ca’
--2016-06-17 16:40:18-- http://xn--spider-9f0ca/
Resolving ‐‐spider (xn--spider-9f0ca)... failed: No address associated with hostname.
wget: unable to resolve host address ‘xn--spider-9f0ca’
--2016-06-17 16:40:29-- http://www.howtogeek.com/
答案 0 :(得分:1)
在wget ‐‐output-file=logfile.txt
中,output-file
之前的两个字符不是(ASCII)HYPHEN-MINUS(-
,U + 002D),而是HYPHEN(‐
, U + 2010)。这就是为什么wget的选项解析器不会将其识别为选项,而是尝试将其解析为主机名。
--recursive
和--spider
有同样的问题。
删除这些连字符并使用 - (减号)键重新键入它们。那应该解决它。