I want to extract content from an HTML using xpaths using Java. In ruby I can do this using nokogiri as shown here.
xpath = '/html/body/div/div[2]/div[2]/div/div[2]/div[3]/p'
doc = Nokogiri::HTML(open('test_001_html64.html'))
doc.xpath().each do |link|
puts link.content
end
I want to do it in pure Java. I looked at Jsoup but I couldn't find any documentation or example that uses an xpath to do this. Can someone suggest a way?
Thanks