10

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?

Kevin
  • 203

2 Answers2

28

Use the -O option:

wget "http://www.finance.yahoo.com/q/op?s=GOOG" -O goog.txt 
codaddict
  • 701
  • 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 'SO- stop being evil' Apr 30 '11 at 12:12
8
curl "http://www.google.com/" >> /Users/name/desktop/temp.txt
  • 7
  • 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