Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Posts: 39530
776
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul Clapham
Yes you are right runtime javascript loading is something which is creating problem.

Thanks for giving your time.
 
The only cure for that is hours of television radiation. And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!