LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   404 error when using wget to download pdf -- related to Save File popup (https://www.linuxquestions.org/questions/linux-software-2/404-error-when-using-wget-to-download-pdf-related-to-save-file-popup-838470/)

jj3286 10-16-2010 05:36 AM

404 error when using wget to download pdf -- related to Save File popup
 
Hello:
I have a link to a pdf file, and I want to use wget (or python) to download the file. If I type the address into Firefox, a dialog box pops up asking if I want to open or save the pdf file. If I give the same address to wget, I receive a 404 error. The wget result is below. Can anyone suggest how to use wget to save this file? Thanks.

wget http://dynamodata.fdncenter.org/990s...&rt=990EZ&t9=A
[1] 4619
[2] 4620
[3] 4621
[2]- Done yr=200812

nebm@nebm:~$ --2010-10-16 03:33:15-- http://dynamodata.fdncenter.org/990s...?ein=850475649
Resolving dynamodata.fdncenter.org... 206.17.146.54
Connecting to dynamodata.fdncenter.org|206.17.146.54|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://tfcny.fdncenter.org/990_pdf_a...50475649__.pdf [following]
--2010-10-16 03:33:16-- http://tfcny.fdncenter.org/990_pdf_a...50475649__.pdf
Resolving tfcny.fdncenter.org... 12.39.246.83
Connecting to tfcny.fdncenter.org|12.39.246.83|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2010-10-16 03:33:16 ERROR 404: Not Found.

[1] Exit 8 wget http://dynamodata.fdncenter.org/990s...?ein=850475649
[2]- Done yr=200812
[3]+ Done rt=990EZ

adolfo.pa 10-16-2010 06:42 AM

Hi,

The problem is the '&' characters embedded in the URL. The ampersand is a special shell character used to execute a command in the background.

To make things work as you expect, you'll have to quote the URL:

wget "THE URL"

Both single and double quotes will work.


All times are GMT -5. The time now is 12:09 PM.