LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-06-2010, 12:57 PM   #1
chekhov_neo
LQ Newbie
 
Registered: May 2010
Location: Bangalore
Distribution: Ubuntu
Posts: 22

Rep: Reputation: 2
How to get the source code of a web page from linux command line?


Hi.

I'm trying to get the source code of a web page from linux command line and save it to a file. I googled for it but didn't get any info. I'm not sure if wget can do this. Please help. Thanks in advance!
 
Old 05-06-2010, 01:00 PM   #2
benjam1nrk
LQ Newbie
 
Registered: Mar 2010
Distribution: CentOS
Posts: 19

Rep: Reputation: 1
This is newbie advice to a newbie, but you should be able to use something along the lines of:

# curl http://thesite.com/thepage.html >> /home/pagesource.txt

Anyone feel free to correct..
 
1 members found this post helpful.
Old 05-06-2010, 01:41 PM   #3
chekhov_neo
LQ Newbie
 
Registered: May 2010
Location: Bangalore
Distribution: Ubuntu
Posts: 22

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by benjam1nrk View Post
This is newbie advice to a newbie, but you should be able to use something along the lines of:

# curl http://thesite.com/thepage.html >> /home/pagesource.txt

Anyone feel free to correct..
That worked like magic! thank you..
 
Old 05-07-2010, 07:29 AM   #4
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
you can also do similar thing using wget.
 
Old 05-07-2010, 07:38 AM   #5
ajeetsinghraina
Member
 
Registered: May 2010
Location: India
Distribution: Ubuntu 7.04/8.04/8.10/10.04, RHEL 6, OpenSUSE,Mandriva,Fedora, CentOS, XandrOS, Slackware, OpenSolar
Posts: 155

Rep: Reputation: 55
My Favourite:
Code:
wget -r -O downdloadedtext.txt --page-prequisites --follow-tags http://linuxhunt.blosgpot.com
 
  


Reply

Tags
page, source, web, wget


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
executing linux commands from web page and outputing it back to the web page ashes_sheldon Programming 8 05-09-2009 06:19 AM
How to get the source code of command line ? the_cpp Programming 6 01-24-2009 09:01 AM
Printing 2 pages in 1 page paper in (Redhat) Linux using command line elmer1503 Linux - General 5 02-01-2006 03:13 AM
C program code to run a Linux command line Linh Programming 10 06-11-2003 01:59 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration