wget下载CSS @import,但忽略其中引用的文件

Jan*_*dek 10 css wget

我使用wget如下:

wget --page-requisites --convert-links -e robots=off \
     --span-hosts --restrict-file-names=windows \
     --directory-prefix=$ASSETS_DIR --no-directories http://myhost/home
Run Code Online (Sandbox Code Playgroud)

HTML页面引用样式表文件application.css,其中包括以下内容:

@import url(https://fonts.googleapis.com/css?family=Quicksand:700);
Run Code Online (Sandbox Code Playgroud)

wget正确创建一个css@family=Quicksand%3A700包含以下内容的文件:

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 700;
  src: local('Quicksand Bold'), local('Quicksand-Bold'), url(https://themes.googleusercontent.com/static/fonts/quicksand/v3/32nyIRHyCu6iqEka_hbKsonF5uFdDttMLvmWuJdhhgs.ttf) format('truetype');
}
Run Code Online (Sandbox Code Playgroud)

但是,wget不会下载此处引用的实际TTF文件.当我更改镜像页面上的CSS并@font-face直接粘贴规则时application.css,它会下载TTF文件.(但我不想那样做 - 我更喜欢继续使用@import谷歌字体).

有没有办法强制wget解析@imported样式表并下载其引用?

Wil*_*iam 4

尝试wget -m -p -E -k -K -np http:\\mysite.com。我遇到了同样的问题,这个解决方案对我有用:下载网页和依赖项,包括 css 图像