Click to See Complete Forum and Search --> : Get Source


Drakelet
05-15-2008, 03:26 PM
Does anyone know a way to get the source of a webpage from an input field? As in, put a URL in a text input field and then get the webpage's source? And, with that source, set it as a variable or something.

Put simply, what it would do is get the source and copy it into a new page (effectively duplicating the page).

It doesn't really matter which language it is in as I'm currently trying to learn them all, slowly but surely.

Thanks.

PS: Actually, is this what proxies do?

ray326
05-15-2008, 11:46 PM
There are libraries and classes for almost every language that will allow you to create an HTTP connection and make a request through it. In Java it's in the java.net and java.io packages.

http://www.davidreilly.com/java/java_network_programming/#2.3

Drakelet
05-18-2008, 06:07 AM
Sorry, but I don't fully understand. :(

What would be the best place for me to get started?

ray326
05-19-2008, 12:47 AM
The place to get started would be learning what a "web client" is and how it works. The only book I've ever seen on that is an old O'reilly on programming web clients in Perl. Of course you have to know a little about Perl, too, but the content of that book is excellent. An alternative would be to visit http://www.freesoft.org/CIE/RFC/index.htm and read the HTTP RFCs, 1945 and 2068.

Drakelet
05-19-2008, 06:22 AM
Thanks.