Getting ready

To prepare this recipe, we need to do the following:

  1. Create a new Maven project
  2. 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>
  1. 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>
  1. Save it in the project's root directory
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.143.41