Thank you in advance for your time. The code is supposed to connect to the website, and scrape the OS model from the line that has a word that is inputted by the user. It will search for the word, go to that line, and scrape the OS attribute on that line for that word. I don't see as to why my code is not working, and would appreciate some help please.
Here is the website http://www.tabletpccomparison.net/
Here is the code:
import java.io.IOException;
import java.util.Iterator;
import java.util.Scanner;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
public class ExtraPart1 {
public static void main(String args[]) throws IOException{
Scanner input = new Scanner(System.in);
String word = "";
System.out.println("Type in what you are trying to search for.");
word = input.nextLine();
System.out.println("This program will find a quality from a website for it");
String URL = "http://www.tabletpccomparison.net/";
Document doc = Jsoup.connect(URL).get();
Elements elements = doc.select("a");
for(Element e : elements){
if(e.equals(word)){
String next_word = e.getElementsByClass("tableJX2ope_sis").text();
System.out.print(next_word);
}
}
}
}