• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to save a complete webpage including images etc?  RSS feed

 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to write a java program to to save a complete webpage including images etc. to my local disk? How do I achieve this? If I use a URL connection, I can only save the page and not its resources like images etc.

Please help.
 
Rob Spoor
Sheriff
Posts: 20903
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to parse the content, possibly modify it because of links to resources on different servers, or in paths that are not a sub folder of the web page's folder (e.g. src="../images/image.gif"). That's not a trivial job though. Regular expressions or a proper HTML parser can help you out here.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!