1

My main goal is to easily backup the page source for a bunch of MediaWiki pages of mine. I have every page I want downloaded, listed on my username page (https://wiki.example.com/index.php?title=User:username) and currently I can:

wget -r --level=1 https://wiki.example.com/index.php?title=User:username

This downloads MediaWiki's output HTML for each page I linked, but I'd prefer the source of each instead.

With Mediawiki, we can add action=raw to the GET request, like https://wiki.example.com/index.php?title=User:username&action=raw will get the source of User:username.

As such, I'd like wget's -r to append "&action=raw" to the URL of each other link it finds and downloads, but I'm not sure how. Other posts talk about doing it like wget -A '&action=raw' however this Accept flag doesn't seem to do the job.

  • 1
    You won't be able to do this directly with Wget. You're going to need to run wget in --spider mode, parse the output and make a list of all the files you need to download. Scripting is the only solution here – darnir May 31 at 11:37

Your Answer

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

Browse other questions tagged or ask your own question.