【发布时间】:2019-11-03 21:35:20
【问题描述】:
wget 递归到第二个底层并且不再进一步。如果我将底层 HTML 文件指定为源,它会对其进行解析并进一步处理。我认为这可能是由于从 HTML 文档链接的 PDF 文件位于服务器上的不同根文件路径中。我需要它来检索此层次结构中的所有 PDF 文件,因为我将一起推广它们,作为抑郁症意识运动的一部分。
我正在使用基于 linux-gnu 构建的 GNU Wget 1.19.4。
我尝试过 --exclude、--exclude-directory、-l2、-l10、--continue 和许多其他开关。我需要使用 --include 命令或 wget 抓取整个站点。如果我使用 -np 它不会“向上”进入 /docs
此代码为我获取 HTML 文件,但不遵循“最底部”中的链接 HTML 文件。
wget --mirror --include docs/default-source/research-project-files --include about-us/research-projects/research-projects/ https://www.beyondblue.org.au/about-us/research-projects/research-projects/
这段代码,当我手动指定 HTML 文件时,会在其中获取我想要的 PDF 文件。
wget --mirror --include docs/default-source/research-project-files --include about-us/research-projects/research-projects https://www.beyondblue.org.au/about-us/research-projects/research-projects/online-forums-user-research
我希望它访问该分支中的所有 HTML 文件,取出其中的所有 PDF 链接,并从 /docs 检索所有 PDF 文件
https://www.beyondblue.org.au/about-us/research-projects/research-projects/online-forums-user-research
这是其中一份 PDF。 /docs 目录没有列表。
https://www.beyondblue.org.au/docs/default-source/research-project-files/online-forums-2015-report.pdf?sfvrsn=3d00adea_2
我可以让 wget 做的最好的事情就是浏览网站并将 HTML 文件降到这个级别:
https://www.beyondblue.org.au/about-us/research-projects/research-projects/online-forums-user-research
https://www.beyondblue.org.au/about-us/research-projects/research-projects/networks-of-advocacy-and-influence-peer-mentors-in-beyond-blue-s-mental-health-forums
...
150 of them
这似乎是一个深度限制设置或路径遍历限制或其他东西。我怀疑它很容易被发现。 再次感谢!
【问题讨论】: