DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   Reading Source code of a webpage (http://www.daniweb.com/forums/thread89787.html)

yassar Sep 16th, 2007 5:15 am
Reading Source code of a webpage
 
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??

iamthwee Sep 16th, 2007 5:32 am
Re: Reading Source code of a webpage
 
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?

vijayan121 Sep 16th, 2007 7:02 am
Re: Reading Source code of a webpage
 
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


All times are GMT -4. The time now is 11:45 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC