我该怎么做来解析一个URL?

时间:2014-07-22 22:44:43

标签: java eclipse parsing

System.out.println("xmlns = " + attributes.getValue("xmlns"));

我知道我的方法是错误的,但我应该使用什么而不是attributes.getValue(...)

xmls是一个链接,例如:https://fkfdkfkf.com

1 个答案:

答案 0 :(得分:0)

        URL url = new URL("https://fkfdkfkf.com");
        System.out.println(url.getProtocol());
        System.out.println(url.getHost());
        System.out.println(url.getPath());