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

    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.

    Thanks

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

    Default

    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
    Posts
    671
    Rep Power
    6

    Default

    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, 05: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, 01: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, 05: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, 02: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, 05: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
  •