I have a webpage which contains lots of remote assets, like CSS and JavaScript files.

How can I download all the remote assets in a batch, rather than manually?

Is there any recommended tool to do this? Here's an example of a webpage:

    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
    <link href="http://turbo.themezilla.com/memo/wp-content/themes/memo/style.css" media="screen" rel="stylesheet" type="text/css"></link>
    <link href="http://demo.themezilla.com/memo/feed/" rel="alternate" title="Memo RSS Feed" type="application/rss+xml"></link>
    <link href="http://demo.themezilla.com/memo/xmlrpc.php" rel="pingback"></link>
    <meta content="noindex,nofollow" name="robots"/>
    <link href="http://turbo.themezilla.com/memo/wp-content/plugins/zilla-shortcodes/shortcodes.css?ver=3.7.1" id="zilla-shortcodes-css" media="all" rel="stylesheet" type="text/css"></link>
    <link href="http://turbo.themezilla.com/memo/wp-content/plugins/zilla-dribbbler/css/zilla-dribbbler.css?ver=3.7.1" id="zilla-dribbbler-css" media="all" rel="stylesheet" type="text/css"></link>
    <link href="http://turbo.themezilla.com/memo/wp-content/plugins/zilla-likes/styles/zilla-likes.css?ver=3.7.1" id="zilla-likes-css" media="all" rel="stylesheet" type="text/css"></link>
    <link href="http://fonts.googleapis.com/css?family=Merriweather%3A700&ver=3.7.1" id="merriweather-css" media="screen" rel="stylesheet" type="text/css"></link>
    <script src="http://turbo.themezilla.com/memo/wp-includes/js/jquery/jquery.js?ver=1.10.2" type="text/javascript"></script>
    <script src="http://turbo.themezilla.com/memo/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1" type="text/javascript"></script>
    <script src="http://turbo.themezilla.com/memo/wp-includes/js/jquery/ui/jquery.ui.core.min.js?ver=1.10.3" type="text/javascript"></script>
    <script src="http://turbo.themezilla.com/memo/wp-includes/js/jquery/ui/jquery.ui.widget.min.js?ver=1.10.3" type="text/javascript"></script>
    <script src="http://turbo.themezilla.com/memo/wp-includes/js/jquery/ui/jquery.ui.accordion.min.js?ver=1.10.3" type="text/javascript"></script>
    <script src="http://turbo.themezilla.com/memo/wp-includes/js/jquery/ui/jquery.ui.tabs.min.js?ver=1.10.3" type="text/javascript"></script>
    <script src="http://turbo.themezilla.com/memo/wp-content/plugins/zilla-shortcodes/js/zilla-shortcodes-lib.js?ver=3.7.1" type="text/javascript"></script>
    <script src="http://turbo.themezilla.com/memo/wp-content/plugins/zilla-likes/scripts/zilla-likes.js?ver=3.7.1" type="text/javascript"></script>
    <link href="http://demo.themezilla.com/memo/xmlrpc.php?rsd" rel="EditURI" title="RSD" type="application/rsd+xml"></link>
    <link href="http://turbo.themezilla.com/memo/wp-includes/wlwmanifest.xml" rel="wlwmanifest" type="application/wlwmanifest+xml"></link>
    <meta content="WordPress 3.7.1" name="generator"/>
  • 2
    What OS should this downloader run on?
    – Undo
    Jul 29 '14 at 2:31

Httrack should be perfect for that.

  • very cross platform; Windows, Mac, Linux, and Android
  • free & open source
  • downloads html page and all resources to your computer. Optionally replacing any non-relative links with local links to the resources it downloads.

You can use GNU wget:

  • free and open source
  • Linux, Windows, Mac (brew install wget)
  • CLI

To download all remote assets js,css into local machine in a batch, you can use

wget --page-requisites http://turbo.themezilla.com/memo/
  • --page-requisites: This option causes Wget to download all the files that are necessary to properly display a given HTML page. This includes such things as inlined images, sounds, and referenced stylesheets.
  • This only downloads the files that are on the same server. Mar 29 '18 at 17:15

Bit late but for others searching for an idea to solve a similar problem (maybe you cannot open the page easily outside your browser, you cannot reload because of a form submit or whatever) - I simply used a little JavaScript in the browser's JS-Scratchpad and it's Console:

gregScrList = document.getElementsByTagName('script');
gregString = '';
for( i=0 ; i<gregScrList.length ; i++ ) {
  if( gregScrList[i]['src'] ) {
    gregString += gregScrList[i]['src'] + '\n';

(OK - this is a bit dirty but it was quick ...)

Save the output in a file and use any Download Manager or WGet to download them. Don't forget the Code in the page itself. For that you may use the code inspection and copy the inner HTML of or so ...

  • So, this is only a partial solution, right?
    – Nicolas Raoul
    Nov 18 '15 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.