Reading Source code of a webpage

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2005
Posts: 30
Reputation: yassar is an unknown quantity at this point 
Solved Threads: 0
yassar's Avatar
yassar yassar is offline Offline
Light Poster

Reading Source code of a webpage

 
0
  #1
Sep 16th, 2007
I am trying to read source code of a webpage in C++. I haven't gone too much of a way. Can I read it as a text File??
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Reading Source code of a webpage

 
0
  #2
Sep 16th, 2007
I don't think you can do this with standard c++. Or if you can, you may need third party libraries. A quick search suggests going with the microsoft windows option would seem the easiest.

[search]c++ read webpage[/search]
http://www.daniweb.com/forums/thread50205.html
Look at the msdn website and the documentation for wininet perhaps?
Last edited by iamthwee; Sep 16th, 2007 at 5:34 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: Reading Source code of a webpage

 
2
  #3
Sep 16th, 2007
using libcurl would be a portable way. http://curl.haxx.se/libcurl
source or binaries for a number of platforms are available http://curl.haxx.se/download.html

libcurl can be used directly from c++. curlpp gives a c++ wrapper that uses stl, is exception and type safe; so you may want to use it.
http://rrette.com/textpattern/index.php?s=cURLpp
http://rrette.com/textpattern/index....download&id=35

you could also use curl from the command line.
to retriev a number of web pages (eg. to mirror a complete website), use wget
http://www.gnu.org/software/wget/
for windows: http://www.christopherlewis.com/WGet/WGetFiles.htm
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC