Results 1 to 14 of 14
Like Tree1Likes
  • 1 Post By Norm

Thread: how to fill a field online?

  1. #1
    M0TRIX is offline Member
    Join Date
    Dec 2013
    Posts
    28
    Rep Power
    0

    Default how to fill a field online?

    hello

    i fetch a html registration page online. i need to register in it with java program.how can i fill the fields and push the submit button? could u make an example for me?sample code

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: how to fill a field online?

    Here are two approaches:
    1) Use the Robot class to drive the cursor and keyboard to do what a user would do when looking at a browser's window.
    2) Send HTTP request to the server, read the html page, build a response page and send it to the server.
    M0TRIX likes this.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    M0TRIX is offline Member
    Join Date
    Dec 2013
    Posts
    28
    Rep Power
    0

    Default Re: how to fill a field online?

    tnx. will you give me a sample code?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: how to fill a field online?

    Sorry, I don't give out code.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    M0TRIX is offline Member
    Join Date
    Dec 2013
    Posts
    28
    Rep Power
    0

    Default Re: how to fill a field online?

    al least give me refreance.i'm amator in network programing

    what should i serach about it?
    Last edited by M0TRIX; 07-12-2015 at 04:26 PM.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: how to fill a field online?

    For solution 2) I suggest studying the HTTP protocol and HTML.
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    M0TRIX is offline Member
    Join Date
    Dec 2013
    Posts
    28
    Rep Power
    0

    Default Re: how to fill a field online?

    which one is esay and fast?

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: how to fill a field online?

    Neither.
    If you don't understand my response, don't ignore it, ask a question.

  9. #9
    M0TRIX is offline Member
    Join Date
    Dec 2013
    Posts
    28
    Rep Power
    0

    Default Re: how to fill a field online?

    any one can put a sample code?

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: how to fill a field online?

    Check out Google. I'm sure it can find lots of sample code.
    If you don't understand my response, don't ignore it, ask a question.

  11. #11
    M0TRIX is offline Member
    Join Date
    Dec 2013
    Posts
    28
    Rep Power
    0

    Default Re: how to fill a field online?

    the problem is i don't know what to google exactly

  12. #12
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: how to fill a field online?

    I don't either. The project is in java and involves networking use of HTTP and HTML. Start with those.
    You will need to try different search values to see what they return and refine the search args as you learn more about what is returned.
    If you don't understand my response, don't ignore it, ask a question.

  13. #13
    Andrewluj is offline Member
    Join Date
    Jul 2015
    Posts
    1
    Rep Power
    0

    Default Re: how to fill a field online?

    It sounds like Jaunt - Java Web Scraping & Automation may be really useful to you then. It makes it very easy to accomplish what you want to do, and they provide example code on their site.

  14. #14
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,989
    Rep Power
    8

    Default Re: how to fill a field online?

    Wouldn't it be much easier to find out how the POST is made from the webpage? Use Fiddler2 to see the POST data and rebuild that with your WebClient. Getting a HttpClient (Thank you Apache HttpComponents!) to do that POST for you would probably be the correct way. Screen scraping is frowned upon by most sites. Besides, one little HTML change and you're screwed. Ofcourse, when they change the parameters for the login, you run into problems as well. But that's price you pay for using a "service" you're not supposed to use that way.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

Similar Threads

  1. fill out an online survey via java
    By Android_Newbie22 in forum New To Java
    Replies: 2
    Last Post: 11-21-2011, 12:00 AM
  2. front end display of field description when clicking the field name
    By neils in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 10-29-2010, 11:47 AM
  3. Replies: 1
    Last Post: 10-25-2010, 12:20 PM
  4. Replies: 4
    Last Post: 01-17-2010, 11:13 PM
  5. Replies: 12
    Last Post: 04-18-2009, 12:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •