gpt4 book ai didi

linux - 允许Wget只下载应用类型的PDF

转载 作者:太空宇宙 更新时间:2023-11-04 11:03:51 25 4
gpt4 key购买 nike

我在 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com