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 know that wget can fetch a remote page and its dependencies and rewrite the html so that image src attributes reference the newly downloaded images.

I am trying to convert local html files that reference images on the Internet. I'm using

wget --mirror --page-requisites --convert-links \
     --directory-prefix=foo \
     --force-html \

All of the referenced images are downloaded to the appropriate places in foo/ but the src attributes in my_file.html aren't being changed.

share|improve this question

migrated from stackoverflow.com Jul 17 '11 at 11:36

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

Can't you use regex to fix them? –  Misha Jul 10 '11 at 4:35
Yes, I was hoping that I could use wget's built in functionality, but I ended up replacing the attributes manually. –  Kevin L. Jul 11 '11 at 14:30

1 Answer 1

Try this:

 wget --recursive   --page-requisites --html-extension=on --convert-links="on" --domains="www.thesite.com" --no-parent http://www.thesite.com  

This will bring you an entire website locally. just tried it, working fine.
with local resources

share|improve this answer
I already have the website; the problem was that the links weren't being rewritten. in my_file.html –  Kevin L. Jul 11 '11 at 14:29
@Kevin L. Please provide the site url that you want to download. BTW, if the links made in JavaScript, you cant do it with wget. nevetheless, provide the url. –  fatnjazzy Jul 12 '11 at 4:09

Your Answer


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

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