Parse the inner html tags using jSoup
问题 I want to find the important links in a site using Jsoup library. So for this suppose we have following code: <h1><a href="http://example.com">This is important </a></h1> Now while parsing how can we find that the tag a is inside the h1 tag? 回答1: You can do it this way: File input = new File("/tmp/input.html"); Document doc = Jsoup.parse(input, "UTF-8", "http://example.com/"); Elements headlinesCat1 = doc.getElementsByTag("h1"); for (Element headline : headlinesCat1) { Elements importantLinks