|
|
Subject:
Using Java to fill out forms on web pages
Category: Computers > Programming Asked by: amirehsans-ga List Price: $12.00 |
Posted:
04 Nov 2003 21:05 PST
Expires: 11 Nov 2003 14:40 PST Question ID: 272743 |
Hi. I was wondering if you could give me a simple piece of Java code that could fill out an online form for me. The whole idea is, let's say there are 5 fields on a page (not my own, just on the net) and I know what I want to put in them, but I want my java code to do it for me. How can this be done? Let's say I don't want it to be "that" intelligent. So for the first time, I go and look at the HTML code of the page and pull out the name of all the fields to be filled or check boxes to be checked, or *BUTTONS to be pushed*. So I know the name of the components. Now can I tell my program to go to a webpage and "click" on the button labeled blah, and put "blah" into the text field called blah2, etc? I would really appreciate your help. | |
| |
| |
| |
|
|
There is no answer at this time. |
|
Subject:
Re: Using Java to fill out forms on web pages
From: wengland-ga on 11 Nov 2003 09:05 PST |
Greetings! Assuming you really are wanting to submit forms to the Readers Digest website, they use quite a bit of client side scripting (Javascript) for form validation and submission. This would preclude simply creating a HTTP POST request with the values in it. You'd need to disassemble what they do with the Javascript and either mimic the functionality, or automate the submission with the web browser. Java does not have a way to control Windows applications, such as pasting text in a box, or clicking on an image. However, you can do this with either Visual Basic, or WinBatch. I know very little about those applications, so I leave it to other researchers to flesh this out. The general idea with Visual Basic would be to create your own non-visual webbroswer using the IE components to handle the page render and Javascript. VB can be used to read in your joke submissions from a database or text file, and populate the form. With WinBatch, it acutally automates the 'tab' and 'enter' keys you'd hit while navigating the page. I assume it would also have a mechanism to open text files , copy data, and paste it into the forms on the page. Good luck on your quest! |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |