Reputation: 11251
I try in such way:
HtmlPage currentPage = (HtmlPage) webClient.getPage((urlList.get(i).toString()));
And have:
java.net.MalformedURLException: no protocol: HtmlImage[<img src="http://media.animewallpapers.com/wallpapers/misc/misc_164_t.jpg?m=21312126359""
What is a correct way?
Upvotes: 0
Views: 162
Reputation: 43434
In order to get the src
attribute from an image you need to use the getSrcAttribute()
method. Suppose myImage
is an HtmlImage object, this code would output the src
attribute to the console:
System.out.println(myImage.getSrcAttribute());
As a side note, casting an image as an HtmlPage
will most likely throw an exception.
Upvotes: 1