Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Nov 9 '11 at 0:08

This question came from our site for professional and enthusiast programmers.

    
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
add comment

1 Answer

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'
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.