I am trying to get an exact replica of one page. I use:

wget -E -H -k -K -p http://example.com

Everything works well except:

  1. If in my style there is an import of another CSS file it does not get downloaded.
  2. If JavaScript places the images anywhere then they are not downloaded (put a class on an anchor tag and then in my script.js file have jQuery put an image there.

Any ideas how to get either of those to work?

  • Look here. Wget cannot interpret JavaScript or css. You need JavaScript capable browser. If it's a single site, you can try to extract links with regexp. – Banthar Jul 6 '11 at 21:32
  • @banthar ...I would like to download the files that are in the javascript or in the css. Do you have any place you can send me for reference on how to figure out that regular expression? – rich Jul 6 '11 at 21:50

I use pavuk for mirroring and it works great - the resultant mirror is viewable in browser and it also partially parses the javascript (but of course not completely):

/usr/bin/pavuk -enable_js -fnrules F '*.php?*' '%o.php' -tr_str_str '?' '_questionmark_' -norobots -dont_limit_inlines -dont_leave_site http://www.example.com/ >OUT 2>ERR &

You may also use the -skip_url_rpattern to skip some unuseful dynamic scripts from being mirrored, e.g.:

-skip_url_rpattern 'index.php\?Addcomm=' -skip_url_rpattern 'index.php\?cal=1'
|improve this answer|||||

Your Answer

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