Java XPath HTML : grab shortcut icon (favicon)

christian8a

New Member
I just want to grab the link to the favicon from a HTML website (parse with Jtidy) and print it on the screen.This doesn't work : \[code\]NodeIterator nl = XPathAPI.selectNodeIterator(doc,/html/head/link[@rel='shortcut icon']/@href); Node w; while ((w = nl.nextNode())!= null) { System.out.println(w.getFirstChild().getNodeValue()); }\[/code\]Thank you !!
 
Back
Top