R
R
Roman Krasnikov2016-09-03 15:03:02
Java
Roman Krasnikov, 2016-09-03 15:03:02

How to use Java to download an html page and related resources, such as images under img tags?

Downloading the page is not a problem. Used the HTTPURLConnection class. Everything downloads great. The problem is downloading resources, because they mostly have relative paths. There was an idea to parse links to resources and if they are defined through absolute or relative paths, then add the protocol + url of the parent site to them. But it's crazy long. Have a smarter idea?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question