• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
David Blaine
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So this form exists on someone else's web site? Your dentist's for example?
 
David Blaine
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Clapham
Sheriff
Posts: 22823
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Blaine
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Paul Clapham
Sheriff
Posts: 22823
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the web site's terms of service allow this kind of access? Is the a specific API that they publish?
 
David Blaine
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?

 
Paul Clapham
Sheriff
Posts: 22823
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ivan Jozsef Balazs
Rancher
Posts: 999
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
David Blaine
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 !
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!