-1

I am working on a JavaFX 2.0 application and i want to save a website and it's content by depth, but i do not know how to do this. For example if i want depth 0, it will save the first html page. If the depth is 1 i will save the first html page of the website and all the Subpages of it with their content! I do not know how to do this.

I have this project as homework. I am student!

Anyone can help me out here? I will be very greatfull.

Thanks a lot!

Valentin Vrinceanu
  • 679
  • 1
  • 12
  • 24
  • This doesn't sound as if it has anything to do with JavaFX. What did you try already? – Urs Reupke Apr 25 '12 at 12:45
  • I have tried this: http://stackoverflow.com/questions/238547/how-do-you-programmatically-download-a-webpage-in-java , but the problem is that i don't have any idea how save the child pages. – Valentin Vrinceanu Apr 25 '12 at 12:50

1 Answers1

3

I'm not sure that JavaFX has some special API for this task. The main idea of javaFX may be defined as "tool for builing really cool GUI", but not like "some special tool for some specific tasks on web". Maybe WebView component can help you with your task (as its purpose is working with web). If not - you should work with javaFX on this task just the same way you'll walk with some other framework on it: write your own parser for HTML pages (read a website as a string, parse it for finding all html tags... and so on... XPath can help you there), or find some already existing libraries and use them in your application. So, javaFX can help you in this project as a framework for building GUI, but business logic must be done by some other frameworks.

Victoria Agafonova
  • 2,048
  • 10
  • 33
  • 50