java - XPath contains returning IndexOutOfBounds Exception -


i new xpath. following piece of code checking ? check both these class "a b" when retrieving span elements.

htmlspan resultsspan =  (htmlspan) page.getbyxpath("//span[contains(@class,'a b')]").get(0); 

thanks

this xpath //span[contains(@class,'a b')]" looks span class contains substring "a b". f.e. <span class="ba ba"></span> or <span class="a b"></span> if want span class "a" or class "b" should use //span[@class="a" or @class="b")]


Comments

Popular posts from this blog

apache - setting document root in antoher partition on ubuntu -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -

Process 'command 'F:\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 -