wget format incorrect


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting wget format incorrect
# 1  
Old 08-26-2011
wget format incorrect

I want to extract a web page to a temporary file as a source document. I tried: wget $webPgURL > /tmp/tmpfil
but it says I have a missing URL. I have echoed $webPgURL just prior to the wget command and it is correct. If I use: firefox $webPbURL it brings up firefox with the correct page. Can someone show me the properly set up command?

Last edited by slak0; 08-27-2011 at 02:59 AM..
# 2  
Old 08-26-2011
Try putting quotes around it, "$webPgURL".

Also,wget doesn't work that way, it doesn't output to stdout (by default). Try -O filename
# 3  
Old 08-27-2011
When I enter:
wget $webPgURL -O /tmp/tmpfil 2>&1 >/dev/null
I get error 403 forbidden.
webPgURL="http://www.google.com/search?q=bluetest"

Last edited by slak0; 08-27-2011 at 02:59 AM..
# 4  
Old 08-28-2011
wget format incorrect

The solution comes thru using the option: -U firefox.
Apparently when doing a search then grabbing the search page it needs this "user-agent". So now it works when constructed as:
url="http://www.google.com/search?q="
xx="red%20green"
wget -U firefox -O /tmp/tmpfil $url$xx
will save the souce document into tmpfil as needed
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk incorrect format

I was wondering whether anyone has any idea what is happening here. I'm using simple code to compare 2 tab delimited files based on column 1 values. If the column1 value of file1 exists in file2, then I'm to print the column4 value in file2 in column3 of file1. Here is my code: 1st I have to... (6 Replies)
Discussion started by: Geneanalyst
6 Replies

2. Solaris

Incorrect vCPU numbering

Hi All, Currently experiencing more-so a visual issue when typing psrinfo, mpstat commands, as the virtual processors start from 8-39, as below: # psrinfo -pv The physical processor has 32 virtual processors (8-39) UltraSPARC-T2 (chipid 0, clock 1165 MHz) Can't seem to find anything to... (0 Replies)
Discussion started by: alx_mck
0 Replies

3. Shell Programming and Scripting

Wget - working in browser but cannot download from wget

Hi, I need to download a zip file from my the below US govt link. https://www.sam.gov/SAMPortal/extractfiledownload?role=WW&version=SAM&filename=SAM_PUBLIC_MONTHLY_20160207.ZIP I only have wget utility installed on the server. When I use the below command, I am getting error 403... (2 Replies)
Discussion started by: Prasannag87
2 Replies

4. UNIX for Dummies Questions & Answers

[SOLVED] Field $() is incorrect 'what does it mean'

I am creating (or trying to) an awk script to retrieve various data from an input file and output the data in a different format. I think it is self explanatory what I am attempting but I getting the error Field $() isincorrect when I reun it using awk -f file.awk inputfile #!/bin/awk -f... (3 Replies)
Discussion started by: Bruble
3 Replies

5. Solaris

Incorrect login NIS?

Hello, I have an issue with a NIS client station on my network. I can't log onto with any NIS login and it prompt "Login incorrectl please try again". My others stations work correctly and log on without problem. This station worked correctly before yesterday, but yesterday we've got a power... (5 Replies)
Discussion started by: Juterassee
5 Replies

6. UNIX for Dummies Questions & Answers

login incorrect

Hi to all, I get a problem when i tried to modifie the password of the root,but thi s the message i have on root password,even i put the old password i have the same message "password has expired, you are allowed to entry by daemon"Could any one give me any suggestion to solve the problem?... (2 Replies)
Discussion started by: espace1000
2 Replies

7. Red Hat

Login Incorrect

I have rebooted my box (Redhat Linux) and the system is back online now, but Iam unable to login via ssh for all the users including root, it says "Login Incorrect". I am pretty sure the username/password is correct.May be the password or the shadow file is corrupted ??? How do i login to the... (6 Replies)
Discussion started by: sydney2008
6 Replies

8. Forum Support Area for Unregistered Users & Account Problems

user name is incorrect

Hello. I registered yesterday with a username of "kailor" and a password of removed. I could only logon with a username of "keithailor@comc" and the above password. I want my username to become "kailor" and my password to remain as removed. Please email me with the steps to correct this. ... (1 Reply)
Discussion started by: keithailor@comc
1 Replies

9. UNIX for Advanced & Expert Users

memory configuration incorrect?

MIS/IT Area - Sun: Solaris Forum eb222 (MIS)3 replies20 Mar 07 (20 Mar 07) something wrong with my memory bank table I have run prtdiag and the memory bank table doesnt look right -can somebody confirm if below looks ok? ============================ Memory Configuration... (1 Reply)
Discussion started by: eb222
1 Replies

10. UNIX for Dummies Questions & Answers

Incorrect Directory Name

Hi, Can anyone help me. I have a problem when i try to find a particular directory using one enviroment, but it can find it in another. We have two enviroments ias9i and 9iAS when we run ldd -s filename for a particular file, the file is found but the directory is marked as ignore with... (1 Reply)
Discussion started by: jand102821
1 Replies
Login or Register to Ask a Question