Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Help on developing code for autoform fill in website

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Help on developing code for autoform fill in website

    Hi ,

    I am planning for a code which will open a webpage and fill the form present in the
    web page automatically using data present in a XML file.

    Not able to finalize how to start with...?
    I just have some basic knowledge of Java, help required on how to start.


    Thanks.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,408
    Thanks
    49
    Thanked 2,213 Times in 2,186 Posts

    Default Re: Help on developing code for autoform fill in website

    Is your project supposed to simulate a user with a browser? It loads an HTML page with a form, fills in the data and presses submit?
    You'll need to understand HTTP.
    Are you going to use 3rd party packages or write it yourself.

  3. The Following User Says Thank You to Norm For This Useful Post:

    hari061204 (March 6th, 2012)

  4. #3
    Junior Member
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Help on developing code for autoform fill in website

    Thanks for the reply,

    Entirely about the proj: A unix job after successful run should call a java code, which should open a given web link, that link has a form which should be filed by the data present in a XML file automatically .
    The XML file is created by the unix job.

    Form filling can be done in background and a reference number will be generated after filling the form need to be captured.

    No 3rd party software's are used.
    Unix part is done, Java code is pending.

  5. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,408
    Thanks
    49
    Thanked 2,213 Times in 2,186 Posts

    Default Re: Help on developing code for autoform fill in website

    You missed this part of my question:
    Is your project supposed to simulate a user with a browser? It loads an HTML page with a form, fills in the data and presses submit?

  6. #5
    Junior Member
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Help on developing code for autoform fill in website

    Yes.
    As a part of reducing manual effort.

  7. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,408
    Thanks
    49
    Thanked 2,213 Times in 2,186 Posts

    Default Re: Help on developing code for autoform fill in website

    Do you understand HTTP? You will need to know how it works.

    To read the HTML page from a server there are several classes you can use: HttpURLConnection, URLConnection or Socket. Easiest first to more work required by you last.
    I'm not sure what classes to use to parse the HTML. I don't think there are any for javascript.

  8. #7
    Junior Member
    Join Date
    Aug 2010
    Location
    UK
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Help on developing code for autoform fill in website

    @Norm - parsing HTML

    Java's Standard Library has this class:

    ParserDelegator (Java Platform SE 7 )

    Which can do HTML parsing for you. However, most Java programmers I know tell me steer clear of it and use one of the many 3rd party HTML parsers available: TagSoup, JTidy, NekoHTML Jsoup etc.

    And out of those Jsoup seems to be the populist choice at the moment because of it's flexible and easy to use API. You can traverse a document using the standard DOM model or use CSS (JQuery like) selectors.


    Hope this helps.

Similar Threads

  1. Developing Java application for iPad
    By Alinani in forum Java ME (Mobile Edition)
    Replies: 6
    Last Post: August 3rd, 2012, 05:05 PM
  2. problem developing a frame help me...
    By bluestar_me in forum AWT / Java Swing
    Replies: 3
    Last Post: February 18th, 2012, 04:18 AM
  3. Getting Value from Website source code.
    By Blackbird94 in forum Java Theory & Questions
    Replies: 2
    Last Post: August 26th, 2011, 07:16 AM
  4. Need help in developing a clock application
    By sb.shiv in forum AWT / Java Swing
    Replies: 2
    Last Post: August 24th, 2010, 02:00 AM
  5. How to develop plugins in Netbeans?
    By haygaurav in forum Web Frameworks
    Replies: 1
    Last Post: May 27th, 2009, 04:49 PM