Question
Java I want to read the text from a webpage. The Div to read is the div class and ignore the rest. Cannot get it
Java I want to read the text from a webpage. The Div to read is the div class and ignore the rest. Cannot get it to work gave an example webpage not the ones I will be doing. Needs to read the div, and output top 10 words and times used
import java.io.*; import java.util.*; import org.jsoup.*; import org.jsoup.nodes.*;
public class TextAnalyzer { public static void main(String[] args) throws IOException { Document doc = Jsoup.connect("https://www.oracle.com/corporate/features/jsoup-html-parsing-library.html").get(); Element div = doc.select("div#divClass").first(); String divText = div.text(); Scanner scan = new Scanner(divText); Map
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started