Results 1 to 5 of 5
  1. #1
    shahid0627 is offline Member
    Join Date
    Aug 2009
    Posts
    16
    Rep Power
    0

    Exclamation How to retrieve information from website using java

    Hello,
    I want to retrieve weather information of 'Chittagong' city of 'Bangladesh' country from "BBC.com/weather" from java application.
    but i don't understand where from i should start.

    Please give me suggestions.

    Thanks,
    Shahid

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,259
    Rep Power
    25

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,308
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by shahid0627 View Post
    Hello,
    I want to retrieve weather information of 'Chittagong' city of 'Bangladesh' country from "BBC.com/weather" from java application.
    but i don't understand where from i should start.

    Please give me suggestions.

    Thanks,
    Shahid
    Start reading the API documentation for the URL class; you can get a URLConnection from a URL and you can get an InputStream from such a connection. You can read all that html crap from that InputStream.

    kind regards,

    Jos

  4. #4
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    the web site probably does not have an official web services API/
    so then I guess creating some kind of HTTP client (e.g. commons-httpclient) to invoke HTTP GET requests to the site with the appropriate URL and parameters to have it display the page you are interested in.
    And then having some kind of heuristic to parse and interpret the HTML response you get from that.

  5. #5
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,308
    Blog Entries
    7
    Rep Power
    20

Similar Threads

  1. [Java] getting links from website source
    By pietertje in forum New To Java
    Replies: 6
    Last Post: 07-01-2010, 09:36 PM
  2. Issues with a particular website (Java + forms)
    By aromes in forum Advanced Java
    Replies: 1
    Last Post: 04-13-2009, 03:16 AM
  3. How to download website (Get all link in website)
    By finalmem in forum Advanced Java
    Replies: 0
    Last Post: 11-12-2008, 08:43 AM
  4. Kode Java Website
    By wsaryada in forum Reviews / Advertising
    Replies: 4
    Last Post: 01-18-2008, 09:16 PM
  5. website java button layout
    By abcdefg in forum AWT / Swing
    Replies: 0
    Last Post: 12-25-2007, 04:44 PM

Posting Permissions

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