Unable to download pdf file using wget

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?

2

1 Answer

EDIT:

Reading your question again I think I didn't understand it correctly. If you want wget to recursively download all PDFs linked on , 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 ""

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 ""
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like