@CyanCoding/

Wikipedia Post Viewer

Java

View Wikipedia pages through this program

fork
loading
Files
  • Main.java

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.44960655655136694","path":"Main.java","file":{"path":"Main.java","content":{"asEncoding":{"base64":"aW1wb3J0IGphdmEudXRpbC5maWxlCmNsYXNzIE1haW4gewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIEZpbGUgaW5wdXQgPSBuZXcgRmlsZSgiaW5wdXQuaHRtbCIpOwogICAgICAgIERvY3VtZW50IGRvYyA9IEpzb3VwLnBhcnNlKGlucHV0LCAiVVRGLTgiLCAiaHR0cDovL2V4YW1wbGUuY29tLyIpOwoKICAgICAgICBFbGVtZW50IGNvbnRlbnQgPSBkb2MuZ2V0RWxlbWVudEJ5SWQoImNvbnRlbnQiKTsKICAgICAgICBFbGVtZW50cyBsaW5rcyA9IGNvbnRlbnQuZ2V0RWxlbWVudHNCeVRhZygiYSIpOwogICAgICAgIGZvciAoRWxlbWVudCBsaW5rIDogbGlua3MpIHsKICAgICAgICAgICAgU3RyaW5nIGxpbmtIcmVmID0gbGluay5hdHRyKCJ0aXRsZSIpOwogICAgICAgICAgICBTdHJpbmcgbGlua1RleHQgPSBsaW5rLnRleHQoKTsKICAgICAgICB9CiAgICB9Cn0="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import java.util.file
class Main {
    public static void main(String[] args) {
        File input = new File("input.html");
        Document doc = Jsoup.parse(input, "UTF-8", "http://example.com/");

        Element content = doc.getElementById("content");
        Elements links = content.getElementsByTag("a");
        for (Element link : links) {
            String linkHref = link.attr("title");
            String linkText = link.text();
        }
    }
}