Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    454

    Unanswered: How to get the page source code?

    I want to get the page source code (HTML) based on the page URL. I remember that there is a class which can do that, but I forget the class name. Can anyone help me? Thanks in advance.

  2. #2
    Join Date
    Apr 2004
    Posts
    2
    this has nothing to do with databases

    when java gets file off the net, it displays the text i.e. the source anyway. It isn't a browser, so doesn't interpret the html in anyway

  3. #3
    Join Date
    Feb 2004
    Posts
    18
    Yes there is a set of classes available under java.net package in Java to do it. First you need to get a URLConnection then call
    openConnection().getInputStream() method on the URL connection object. This will give you an InputStream of the HTML page. You can refer to the Java API for more information.

  4. #4
    Join Date
    Dec 2003
    Posts
    454
    I already did it in this way. Anyway, thanks.

Posting Permissions

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