I need to write a program (using Dev-C++) which can count the number of hyperlinks of a given web page. The main objective is to practice socket programming and try to use HTTP protocol.

I am not sure exactly how to go about doing this. Can anyone help me figure out how to do this? References or suggestions or anything that would point me in the right direction would really help.
(This is for my networking class)

Requirements:
a. Input: The users enter the URL of the desired web page without “http://”.
b. Output: Print all hyperlinks and the number of hyperlinks. Note that only <a href=”xxx”> should be counted while <link href=”xxx”> shouldn’t.

Recommended Answers

All 2 Replies

Have you read Beej's guide to socket programming?

No, i haven't read it but i will read it and see if it helps. Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.