|
Hello all,
I am a Java developer and am wondering how do I use a java program to post to form and fill in some text on webpages?
example: do a program that posts a message to:
http://long_john321.t35.com
thats a site done by me to test this.
I would be thankful if anyone would tell me how to do this or give a hint to a program w/ source, howto, tutorial or book.
Thanks!
|
|
|
|
|
Thanks for the answer, but it wasnt what I asked :(
I dont wanna use JSP on the serverside. I wanna do this with PHP, or asp on the serverside and regardless if I have the servers sourcecode or not. (so it works on the site I made for this example). The thing is I want it to work almost as a browser but no clicking!
|
|
|
Ummm OK if I understand you correctly then you basically want to simulate a browser, i.e. automate a form submission.
There are different ways to do this.
In java you might consider looking at HTTPUnit. Probably a bit too complicated if you ask me, overkill for whatever you need.
For perl you can use LWP although I think that WWW::Mechanize is a little more friendly. One thing I did notice with Mechanize is you do need to turn the cache off if you happen to be going to large or many pages.
PHP uses curl to provide you with the http protocol. Should be able to use that to do GET and PUT. This fellow here also wrote a http class that can do screen scraping, his examples seem to be GETs with the parameters passed in the url but should be simple enough to mod for PUT. Here's the url http://www.troywolf.com/articles/php/class_http/
semper fi...
|
|
|
|
|
|
|
|