I'm trying to use wget to save the text of a web page. I run:

wget "http://www.finance.yahoo.com/q/op?s=GOOG" > goog.txt 

to try and save the web page to goog.txt, but instead wget tells me:

Saving to: `op?s=GOOG'

Why is wget acting like this, and how can I get the expected behavior?

migrated from stackoverflow.com Apr 30 '11 at 5:46

This question came from our site for professional and enthusiast programmers.


Use the -O option:

wget "http://www.finance.yahoo.com/q/op?s=GOOG" -O goog.txt 
  • 1
    And to answer the first part of the question (why): wget prints tracing information to standard output and downloads the content to a file whose name is derived from the URL and server response. Also, use -q to suppress tracing information. – Gilles Apr 30 '11 at 12:12
curl "http://www.google.com/" >> /Users/name/desktop/temp.txt
  • 7
    1. The OP is asking about wget, not curl (If you expand on why you recommend curl, this might be fine). 2. One line answers are often not very helpful. Give some modicum of explanation or elaboration to help enrich everyone's experience. – HalosGhost Jul 10 '14 at 21:21

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.