/ / Web Parser Probleme - HTML, Parsing, Jsoup

Probleme mit Webparsern - html, parsing, jsoup

Ich bin ziemlich neu in Java, also entschuldige ich mich für meineMangel an einer großen Menge des Themas an diesem Punkt. Ich versuche, einen HTML-Parser zu programmieren, der Daten von den Elementen dieser URL analysiert und zurückgibt: http://en.wikipedia.org/wiki/Neurons.

Ich erhalte diese Fehlermeldung, wenn ich das Programm ausführe:

Exception in thread "main" java.io.FileNotFoundException: src/product.txt`: (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at org.jsoup.helper.DataUtil.load(DataUtil.java:36)
at org.jsoup.Jsoup.parse(Jsoup.java:88)
at ParserPractice2.main(ParserPractice2.java:16)

Mein aktueller Code sieht so aus:

import java.io.File;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.parser.*;
public class ParserPractice2 {

public static void main(String[] args) throws IOException {

File input = new File ("src/product.txt`:");

Document doc = Jsoup.parse(input, "utf-8", "http://en.wikipedia.org/wiki/Neurons");

Element content = doc.getElementById("bodyContent");
}}*

Any help/feedback would be greatly appreciated by this noobie =)Thanks!

Antworten:

1 für die Antwort № 1

Diese Datei existiert nicht:

new File ("src/product.txt`:");

Vielleicht hast du es gemeint "src/product.txt"?