Question
java I am using the code as a template and I am changing it to read from website instead of text file. that is already
java
I am using the code as a template and I am changing it to read from website instead of text file. that is already done on my version.
** I need to only grab a section of website that is in one of the DIV and ignore the rest. How can I do that?
import java.io.File; import java.io.FileNotFoundException; import java.util.*;
public class TextAnalyzer { public static void main(String[] args) throws FileNotFoundException { File file = new File("src/textFile.txt"); Scanner scan = new Scanner(file); Map
String val = scan.nextLine(); // reading line by line if(map.containsKey(val) == false) // if the string is not inserted in the map yet then insert by setting the frequency as 1 map.put(val,1); else // otherwise remove the entry from map and again insert by adding 1 in the frequency{ int count = (int)(map.get(val)); // finding the current frequency of the word map.remove(val); // removing the entry from the map map.put(val,count+1); } Set
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