gpt4 book ai didi

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

转载 作者:技术小花猫 更新时间:2023-10-29 10:58:19 26 4
gpt4 key购买 nike

我正在使用 wget 如下:

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

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

@import url(https://fonts.googleapis.com/css?family=Quicksand:700);

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');
}

但是,wget 不会下载此处引用的实际 TTF 文件。当我更改正在镜像的页面上的 CSS 并将 @font-face 规则直接粘贴到 application.css 时,它会下载 TTF 文件。 (但我不想那样做——我更愿意继续使用指向 Google 字体的 @import)。

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

最佳答案

试试 wget -m -p -E -k -K -np http:\\mysite.com。我有同样的问题,这个解决方案对我有用:download webpage and dependencies, including css images

关于css - wget 下载 CSS @import,但忽略其中引用的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23754952/

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