To prepare this recipe, we need to do the following:
- Create a new Maven project
- Add the following dependency to the project:
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.3</version>
</dependency>
- Create a file called page.html, and add the following to the file:
<!DOCTYPE html>
<html>
<head>
<title>A title</title>
<meta charset="UTF-8">
</head>
<body>
<div id="div1">Interesting text</div>
<img src="somepicture.jpg" alt="Picture 1" width="500px" height="600px">
<img src="someotherpicture.jpg" alt="Picture 2">
<a href="https://www.somepage.com">Visit Us!</a>
<a href="https://www.someotherpage.com">Visit Them!</a>
</body>
</html>
- Save it in the project's root directory