我使用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样式表并下载其引用?