java - Generate XPath expression of Google search engine -


what xpath expression should use parse google xhtml results page? i'm not able retrieve using

xpathexpression expr = xpath.compile(".//li[@class='g']/div/h3/em/text()"); 

if it's xhtml, need namespace binding on expression

namspace ns = namespave.getnamespace("x", "http://www.w3.org/1999/xhtml"); xpathexpression expr = xpath.compile(     ".//x:li[@class='g']/x:div/x:h3/x:em/text()", null, null, ns); 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -