Interacting with a web page

How would I write a program to interact with a web page? I'm trying to send information to the username and password input fields. Right now I can assume that there are only two input fields on the page.

Edit: I guess I'm looking for specific commands/functions/libraries/whatever. Maybe you could show an example of how to do it on this site?
Last edited on
It would have to emulate what the browser does. That is, use the HTTP protocol. This will typically download a URL, construct a reply and send that.

An alternative is to use "screen scraping" to read a browser's display, populate the fields and send the request. When an open protocol such as HTTP is so well documented and ubiquitous, you wouldn't seriously consider pursuing this route.

A library that can help is CURL ( http://curl.haxx.se/ ). You should be able to find examples there.
Last edited on
Thank you, I was hoping it would be simpler than that. I guess I'll have to do some research. It looks like CURL will help.
Last edited on
I've been reading up on some simple HTTP and HTML stuff... If you have the stomach for it, here's some documentation:
http://www.w3.org/Protocols/rfc2616/rfc2616.html
Hmm today has been successful, I've made a custom proxy in c++, so far only using sockets... it's far from perfect, but it was fun to do!
Topic archived. No new replies allowed.