Results 1 to 3 of 3
  1. #1
    baiwen is offline Member
    Join Date
    Mar 2009
    Rep Power

    Default How to download temporary files as well as web page

    I am writing an application using JDK. I use URL class to create URLConnection to download a web page to parse out some strings and etc.

    It works fine if I only parse string in its html page.

    As we all know, using IE to open a web page will download all temporary files at "Temporary Internet Files" folder, image file, mp3, and etc

    How can I write Java application by using URL/URLConnection/HttpURLConnection classes to not only download a web but all media or objects used by the page and be able to access to those objects WITHOUT opening IE?

    I have been searching and reading all over the place and could not find any clue. I would really appreciate it if some experts share some tips here of how to do it.


  2. #2
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Rep Power


    basically anything that's a "src" attribute must be downloaded. there's probably more, but that's a start. just parse the html and when you come across an attribute you need to download, download that as well.

  3. #3
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Rep Power


    You are basically implementing the guts of a browser. This is not a trivial task, since you must first parse the HTML (IMHO, the built-in HTML parsing code in the current Java release is almost worthless for this purpose), and then familiarize yourself with the voluminous W3C HTML specs to figure out when you need to request objects.

    However, there are tools out there such as Internet Download Manager that already have such functionality. Why not just use one of those?

Similar Threads

  1. Replies: 1
    Last Post: 11-06-2008, 04:47 AM
  2. How to get the temporary deployment folder of ejb from jboss
    By ms987654321 in forum Advanced Java
    Replies: 1
    Last Post: 08-22-2008, 12:41 PM
  3. setting the view to a jsp page from a self refeshing page
    By deepal_205 in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 08-15-2008, 04:41 PM
  4. warning that page has expired and i need to refresh the page again
    By 82rathi.angara in forum JavaServer Pages (JSP) and JSTL
    Replies: 5
    Last Post: 07-15-2008, 01:48 PM
  5. how direct her/ him to the Sun´s download page?
    By willemjav in forum Java Applets
    Replies: 1
    Last Post: 04-17-2008, 04:03 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