Suppose I want my C code to fetch the headline from a website, like www.example.com
How to do that?
Can I write a program in C to do this?
give me a start...
Suppose I want my C code to fetch the headline from a website, like www.example.com
How to do that?
Can I write a program in C to do this?
give me a start...
Read the Beej's Guide to Network Programming.
This is a beginner's guide to socket programming with Internet sockets. It is meant to be a springboard that will launch you into the exciting world of TCP/IP programming.
The easiest way is to use an existing HTTP library, for example libcurl or neon. If you are using some framework, maybe it already has a HTTP client.
There are many way to get your result, but the simple way would be to use a library since parsing html is often complicated.
You could try to use libxml
There is also libcurl which allows you to simulate a browser.
But trying to parse html yourself will be.... painful..