Monday, 20 October 2014

The constructor URL(Elements) is undefined

i m using jsoup Application and trying to get url of web pages. i got urls of web page. i m trying to get only image urls via url parsing but when sending request to url i got this error " The constructor URL(Elements) is undefined "
my question is how can i pass urls that i got from jsoup library here is my code ' public static void main(String[] args) throws IOException {
    Validate.isTrue(args.length == 1, "usage: supply url to fetch");
    String url = args[0];
    print("Fetching %s...", url);
    Document doc = Jsoup.connect(url).get();
    Elements links = doc.select("a[href]");
    Elements media = doc.select("[src]");
    Elements imports = doc.select("link[href]");
' and using
'Elements imagepath = doc.select("[src]");'
and passing this Lement into url parsing function
URL url = new URL(imagepath);
can anyone help me to figure it out how to get url parsing function works thanks in advance

No comments:

Post a Comment