C code for Internet Access

P

Paul Dixon

I would appreciate some help on what is probably a fairly simple thing
to do. I am a hardware designer, so my use of C is relatively limited,
in that I only use it to do what I need to do. Now for my own use, I
want to write a program that will download certain data for me from
the Internet. I have spent a lot of time trying to find books to tell
me how to achieve this, but with my lack of experience (and need) of
using the various Classes, I have not been successful.
I use Microsoft Visual C++ 5.0, though I really only use the C subset.
I want to write a program that will access a web site and allow me to
parse the HTML code line by line, either live as it is received or by
writing it to a file which I will open and read line by line.
Within these lines will be a number of URLs which I wish to extract
one by one and also retrieve the contents of those pages. In this case
I will open, read and close each page before moving on to the next
page. So there is never a need to have more than two different pages
open at the same time.
Can someone provide me with a simple prototype for internet access
that I can expand to perform the tasks I need.
Thanks in anticipation.

Paul Dixon
 
M

Mark A. Odell

(e-mail address removed) (Paul Dixon) wrote in

I use Microsoft Visual C++ 5.0, though I really only use the C subset.
I want to write a program that will access a web site and allow me to
parse the HTML code line by line, either live as it is received or by
writing it to a file which I will open and read line by line.
Within these lines will be a number of URLs which I wish to extract
one by one and also retrieve the contents of those pages. In this case
I will open, read and close each page before moving on to the next
page. So there is never a need to have more than two different pages
open at the same time.
Can someone provide me with a simple prototype for internet access
that I can expand to perform the tasks I need.

Not here. We can help you with C related problems (please post snippets of
compiling code with problems) but once you go outside the bounds of the C
language into networking, web pages, etc. you will need to find a
programming newsgroup that deals with such things.
 
J

jacob navia

Paul Dixon said:
I would appreciate some help on what is probably a fairly simple thing
to do. I am a hardware designer, so my use of C is relatively limited,
in that I only use it to do what I need to do. Now for my own use, I
want to write a program that will download certain data for me from
the Internet. I have spent a lot of time trying to find books to tell
me how to achieve this, but with my lack of experience (and need) of
using the various Classes, I have not been successful.
I use Microsoft Visual C++ 5.0, though I really only use the C subset.
I want to write a program that will access a web site and allow me to
parse the HTML code line by line, either live as it is received or by
writing it to a file which I will open and read line by line.
Within these lines will be a number of URLs which I wish to extract
one by one and also retrieve the contents of those pages. In this case
I will open, read and close each page before moving on to the next
page. So there is never a need to have more than two different pages
open at the same time.
Can someone provide me with a simple prototype for internet access
that I can expand to perform the tasks I need.
Thanks in anticipation.

Paul Dixon

This is off topic actually, it is not very C related.

But anyway, if you use the lcc-win32 compiler you can do

GetHttpUrl("www.my-company.com/index.html","c:\\temp\\index.html");
That will retrieve the URL and store it in the local file as given

Then, you can parse it locally using some program you write.

http://www.cs.virginia.edu/~lcc-win32
 
M

Malcolm

Paul Dixon said:
Can someone provide me with a simple prototype for internet access
that I can expand to perform the tasks I need.
Thanks in anticipation.
OT here. Try programmer's heaven (on th web). They have a vast library of
useful utilities almost certainly including routines to manipulate urls.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,826
Members
47,371
Latest member
Brkaa

Latest Threads

Top