开发者

Tool for get image sources parsed from css

Task is simple. Have a tool which will parse CSS on network website, read the links to images from there and download all of them to structured folders to local disc.

The important is that tool should ready to use, and designer should be able to use. Answer "you can write the tool itself is OK", but not acceptible for r开发者_如何学编程eady tool .


You can get urls from css manually with regular expressions.


To accompany Roman's answer:

/\burl\(['"]?([^'"\)]+)['"]?\)\b/g

will match as $1 almost all images (almost all meaning, that the central part ['"\)] is a bit too strict and will not match URLs with either of these characters in it).

Note that you might get external stylesheets ('@import'), too, with this regexp.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜