Exception in thread "main" java.lang.ClassCastException: class org.jsoup.nodes.Document cannot be cast to class javax.swing.text.Document
Сам код:
import org.jsoup.Jsoup;
import javax.swing.text.Document;
import java.io.IOException;
import java.net.URL;
public class Parser {
private static Document getPage() throws IOException {
String url = "https://www.pogoda.spb.ru/";
Document page = (Document) Jsoup.parse(new URL(url), 3000); // на данном этапе компилятор выдаёт: local variable "page" ins not redundant
return page;
}
public static void main(String[] args) throws IOExceprion, IOException {
System.out.println(getPage());
}
}
Ошибка: Exception in thread "main" java.lang.ClassCastException: class org.jsoup.nodes.Document cannot be cast to class javax.swing.text.Document (org.jsoup.nodes.Document is in unnamed module of loader 'app'; javax.swing.text.Document is in module java.desktop of loader 'bootstrap') at Parser.getPage(Parser.java:12) at Parser.main(Parser.java:17)
