aspose file tools*
The moose likes Other Open Source Projects and the fly likes Java api for downloadin a web page along with CSS and javascript files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Java api for downloadin a web page along with CSS and javascript files" Watch "Java api for downloadin a web page along with CSS and javascript files" New topic
Author

Java api for downloadin a web page along with CSS and javascript files

Jeyram Tamate
Greenhorn

Joined: Sep 29, 2012
Posts: 9
I require a java api which could download a website page along with css and javascript files so that when it is opened offline it should have all the css and javascript effects. Any suggestions would be welcome. Thanks in advance.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30294
    
150

Not sure if any existing Java crawlers support downloading external dependencies. It wouldn't be hard to write one though. You'd get the URL text as a string. Then go through it to get the javascript/css links and download those as strings too.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

There's already a "Save as..." option in the menu of many browsers (IE and Firefox for sure) which tries to do that.

However in the tests I ran, that option didn't work very well. A lot of modern pages seem to use techniques which involve loading CSS and/or Javascript at run time, rather than statically. I expect that anything you found would suffer from the same problem.
Jeyram Tamate
Greenhorn

Joined: Sep 29, 2012
Posts: 9
thank you Jeanne Boyarsky.
After going through some java crawlers I feel its good to write one which I require for my specific need. Now I will download the complete page and also I will download all the javascript and css dependencies through program and will place it to appropriate folders. I hope this would solve my problem. But the javascript which is loaded on runtime is creating problem.
The link for Java Crawlers you have provided is helpful. At least I have some API's where I can look .

Once again thank you for giving your time.
Jeyram Tamate
Greenhorn

Joined: Sep 29, 2012
Posts: 9
Thanks Paul Clapham
Yes you are right runtime javascript loading is something which is creating problem.

Thanks for giving your time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java api for downloadin a web page along with CSS and javascript files