首页 > 解决方案 > Wget 如何在 url 上排除/包含特定链接

问题描述

我正在尝试在 NexusHub 上存档此页面(需要登录)。 https://www.nexusmods.com/newvegas/mods/70879

基本上文件结构是:

nexusmods.com
 nexusmods.com/newvegas
  newvegas/mods
    mods/70879 *[The page I am archiving]*

      70879?tab=files [Download files in links]
      70879?tab=images [Images]
      70879?tab=videos
      70879?tab=docs
      70879?tab=posts
      70879?tab=bugs
      70879?tab=logs
      70879?tab=stats

基本上我只想要 70879 页面中的所有链接。所以所有的选项卡、图像和 zip 文件。但是做这样的事情:

wget -r -l 1 -k -K -E -e robots=off -p --convert-links --no-parent -X https://www.nexusmods.com/newvegas/Sessions --load-cookies "路径/到/cookies.txt" https://www.nexusmods.com/newvegas/mods/70879

结果导致整个 mods/ 部分被保存。这就是 -l 1 存在的原因。我不想要整个网站,我只想要这个特定页面及其特定页面链接,如图像、视频和下载文件。

标签: htmlhttpwebwget

解决方案


推荐阅读