我在 Windows 机器上使用 wget。我只想要pdf文件。如果应用程序/类型是 pdf 。只允许下载
我正在使用这个命令
wget --accept pdf www.google.com
它正在下载谷歌的索引页面。
Length: 19404 (19K) [text/html] Saving to: `index.html@gfe_rd=cr&ei=5O8jVLycNuvA8gftoYGIBg'
我不想让 .如果只有pdf。
任何想法
谢谢
最佳答案
通常是这样
wget --header='Accept: application/pdf' www.google.com
但 google.com 似乎忽略了 Accept: header ,因此您可能想要
wget --debug --header='Accept: application/pdf' www.google.com 2>&1 | grep 'Content-Type: application/pdf'
并测试该命令的结果。
关于linux - 允许Wget只下载应用类型的PDF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26036447/