LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-22-2008, 05:46 AM   #1
ikinnu
Member
 
Registered: Jun 2007
Posts: 64

Rep: Reputation: 15
Command to get output of a URL


Hi,

Given a URL and only the command line, is there any command i can use such that the page output of the URL will be displayed on the command-line screen? I cannot use a browser and also i want to parse the text lines of the resulting page of the URL.

Thanks
 
Old 07-22-2008, 05:51 AM   #2
Vit77
Member
 
Registered: Jun 2008
Location: Toronto, Canada
Distribution: SuSE, RHEL, Mageia
Posts: 132

Rep: Reputation: 17
Download it using wget and then parse it.
 
Old 07-22-2008, 06:09 AM   #3
ikinnu
Member
 
Registered: Jun 2007
Posts: 64

Original Poster
Rep: Reputation: 15
Is there anyway i can output that in the command line instead of a file?
 
Old 07-22-2008, 06:19 AM   #4
Vit77
Member
 
Registered: Jun 2008
Location: Toronto, Canada
Distribution: SuSE, RHEL, Mageia
Posts: 132

Rep: Reputation: 17
If you mean analysing the downloaded file without saving it on HDD, try this:

wget -O - http://url | <your parsing code>
 
Old 07-22-2008, 06:47 AM   #5
ikinnu
Member
 
Registered: Jun 2007
Posts: 64

Original Poster
Rep: Reputation: 15
i have piped this to grep but it doesn't seem to be working. It still outputs the text to screen. I am checking options to wget.
 
Old 07-22-2008, 06:58 AM   #6
Vit77
Member
 
Registered: Jun 2008
Location: Toronto, Canada
Distribution: SuSE, RHEL, Mageia
Posts: 132

Rep: Reputation: 17
You see the output to the stderr device.
To get rid of it redirect the stream to /dev/null:

wget -O - http://www/index.html 2>/dev/null | grep 'TD'
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to redirect the output of exec command output in perl? sudhap85 Linux - Newbie 3 08-28-2009 03:35 PM
How do I parse the output of a command that output to standard out? gauol Programming 9 01-17-2008 01:54 PM
redirecting the output of pwd into konqueror as a url. using bash fiery_ice Linux - Newbie 5 04-05-2006 03:13 PM
URL-Encoding on the command line? MikeyCarter Linux - Software 2 09-27-2005 08:10 AM
Redirecting output to a command-line argument of another command madiyaan Linux - Newbie 1 02-19-2005 04:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration