The website contains a button which I have to click to get the pdf to open.

What I want to do is to use "wget" and the link of that website to download the pdf without me clicking on the button, and then copying the link manually

I used the layer option -l1 but that didn't work.

Anyone an idea?



Reading your question again I think I didn't understand it correctly. If you want wget to recursively download all PDFs linked on https://www.zeewolde.nl/gemeente/formulieren-pdf_42836/, you need to tell it with the -r (or --recursive) flag in addition to the max depth. Additionally, if you want wget to figure out the actual filenames, you can use the experimental --content-disposition option. So the command would be:

wget --recursive --level=1 --content-disposition "https://www.zeewolde.nl/gemeente/formulieren-pdf_42836/"

Note that while you can specify file extensions to be downloaded using the --accept option, you'd have to additionally accept php to make wget download the files in the first place. That will, however, download every php file. It's probably easier to just download everything and manually delete the files you're not interested in.

Original Answer:

You probably didn't enclose the URL in quotes.

The links on the website you provided contain multiple Http GET parameters which are separated with & characters. Those will be interpreted by the shell if you don't escape them. The easiest way to do so is enclosing the whole url in quotes:

wget "http://www.example.com/download.php?param1=hello&param2=world"
  • Tried it, doesn't work unfortunately – Jubanji Aug 21 '19 at 12:03

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.