Results 1 to 2 of 2
  1. #1
    maressalul is offline Member
    Join Date
    Oct 2011
    Rep Power

    Default How to getinnerHtml code form a web page


    There are some web pages that display more information that I can found in web source file.

    Example (web page) : Pariloto - Pariuri Sportive .

    If I get this web page with :

    try {
    URL address = new URL(filename);
    BufferedReader in = new BufferedReader(new InputStreamReader(address.openStream()));

    while ((strLine = in.readLine()) != null) {

    } catch (Exception e) {

    I will not have all the information contained in web page.
    However if I use Mozilla Firefox and RIGHT CLICK -> inspect element , in the Fire Bug I have access to innerHtml which represent the real information that is displayed.

    Haw can I get this innerHtml code from java ?


  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Rep Power

    Default Re: How to getinnerHtml code form a web page

    What you are doing only retrieves the HTML page itself. It does not retrieve anything the page references, and it does not retrieve any dynamic content that might be generated after the HTML is rendered. This has nothing to do with Java, but... If I HAD to do what you are mentioning, I would load the page in an <iframe>. I would then use JavaScript (not Java) to retrieve the content and post it to the Web application server.
    The Java Tutorial. Read it.

Similar Threads

  1. Replies: 6
    Last Post: 01-15-2012, 05:01 AM
  2. Replies: 1
    Last Post: 05-27-2010, 09:48 PM
  3. Replies: 10
    Last Post: 08-12-2009, 04:02 PM
  4. trying to get code in paper form....
    By machine949 in forum New To Java
    Replies: 1
    Last Post: 04-22-2009, 05:09 PM
  5. form and results on same page using servlets
    By perplexingtrax in forum New To Java
    Replies: 3
    Last Post: 04-02-2009, 06:04 PM

Tags for this Thread

Posting Permissions

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