Forums Register Login

want to create a form filler - is java, jsp, html enough ?

+Pie Number of slices to send: Send
There is a form on a website, say for reserving a visit to only one dentist. You fill your details and the date and time you want to visit. Then, it tells you if an appointment can be made or not, somewhere in the webpage.
This web page is NOT protected by CAPTCHA. I don't want to enter my details all the time to look for a reservation. I want to make code to do it for me.

I want to make code which will -

1 - Fill the details into the form and "press" submit.
2 - Then, read the resulting page and find out if a reservation is available or not. If yes, do something like maybe - pop up a GUI message, send e-mail or whatever.
3 - Repeat the above steps every 5 hours or so.

What are the languages and tools I would need to do this job ? Would I need more than java, jsp and html (thats all i know now) to make such code ?

Thanks.

+Pie Number of slices to send: Send
So this form exists on someone else's web site? Your dentist's for example?
+Pie Number of slices to send: Send
 

Bear Bibeault wrote:So this form exists on someone else's web site? Your dentist's for example?



Yes, thats right. I cannot edit the source code of the website. I need to make code which will run on my system and get the results for me.
Thanks
1
+Pie Number of slices to send: Send
In that case you wouldn't need any JSPs or any HTML. (At least, you wouldn't need to write any. The website you're trying to manipulate might have them, of course.) All you need is Java code which sends suitable requests to the web site and handles the responses suitably.

However I'd suggest that instead of writing Java code and getting snarled in the minutiae of the HTTP protocol and HTML parsing, you should look into existing code which handles your requirement. HtmlUnit is one example.
+Pie Number of slices to send: Send
 

Paul Clapham wrote:In that case you wouldn't need any JSPs or any HTML. (At least, you wouldn't need to write any. The website you're trying to manipulate might have them, of course.) All you need is Java code which sends suitable requests to the web site and handles the responses suitably.

However I'd suggest that instead of writing Java code and getting snarled in the minutiae of the HTTP protocol and HTML parsing, you should look into existing code which handles your requirement. HtmlUnit is one example.



Thanks Paul. Is there any apache or google-made alternative to HtmlUnit ?
+Pie Number of slices to send: Send
Sorry, I don't know. I suggested HtmlUnit because other people who know what they are talking about have suggested it for requirements much like yours here on this forum. I haven't done a review of the available alternatives. You could do that if you liked, but what's your objection to HtmlUnit?
+Pie Number of slices to send: Send
Does the web site's terms of service allow this kind of access? Is the a specific API that they publish?
+Pie Number of slices to send: Send
 

Bear Bibeault wrote:Does the web site's terms of service allow this kind of access? Is the a specific API that they publish?



How do I find that out ? I don't think there is any API. I guess I am not doing anything illegal. Just want to do maybe 8 attempts per day.
Also, I will be the only user of this app and won't distribute it to others. Could my app cause legal problems ? I don't want to DDOS them,
just want to avoid the drudgery of filling forms and checking repeatedly ?

+Pie Number of slices to send: Send
 

David Blaine wrote:

Bear Bibeault wrote:Does the web site's terms of service allow this kind of access? Is the a specific API that they publish?



How do I find that out ? I don't think there is any API. I guess I am not doing anything illegal.



You find out by asking them. Look at the bottom of pages for a link to the webmaster, or "Contact Us", or something like that. And look for a "Terms of Use" link, or something like that, to see if they restrict access in any way.
+Pie Number of slices to send: Send
 

I don't want to enter my details all the time to look for a reservation



Your browser might remember the previously entered values and assist you in filling the form.

+Pie Number of slices to send: Send
I tried selenium as suggested on stackoverflow. Works well if you use FF browser 21, fails with FF 22.
Need to tweak it to get the job done.

Wohooo ! No coding needed !
What are you doing in my house? Get 'em tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 951 times.
Similar Threads
JSP to HTML on serverside
HttpSession/HttpRequest and performance
Using form property inside scriptlet
JSF Is it really requirerd
When to use a JSP page?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:58:43.