I am using Microsoft Visual Studio 2010 and C++ language that runs on the console.
I am trying to go to a web page, then get the source of that webpage (What I mean by source is: in Firefox, when you right click, then “View Page Source”) and save it in my computer as a text file, so that I can read that saved file later on. Can you please give me an example of how to go to a website in c++ and then save the HTML source code in to my computer? I would greatly appreciate any help
And how can you install libcurl?
When I use #include <curl/curl.h> it says Error: cannot open source file “curl/curl.h.”
You need to use some of tools that support HTTP e.g. WinINet (Windows) or libcurl (multiplatform). I was using WinINet for communication with web servers and getting the content of the page was pretty easy. Here are some links to give you a hint of what to do:
Get web page using WinInet class wrapper
Using WinInet as an alternative to libcurl