How to programmatically download all contents of webpage, not only the source code in Java
I know how to download a webpage's source in java. But a webpage also contains image url, CSS and JS script url which need to be downloaded later like:
<LINK REL="STYLESHEET" HREF="htmlatex.css"> <img src=p10012.gif>
If I only download the source of a webpage, rendering it in offline mode will need to download this
p10012.gif result in missing contents in offline mode. My objective is to download all contents of webpage programmatically and provide it as assets of an android app. HOw can I do that in java.
Note: please let me know if my question is not clear enough.
I would suggest to use JSoup library to do it as its pretty good HTML parse. You can parse HTML and than iterate over resources to download them. I am not sure but there should be an example on the same topic you asked.