i trying come xpath locate text in span says text locate in second portion of xpath first locating image in tr in td in table in div below it.
this html structure (simplified/pseudocode):
<table> <tbody> <tr> <td> <span>id locate in second portion of xpath </span> </td> </tr> </tbody> </table> <div> <table> <tbody> <tr> <td> <img>imgpartstatus</img> </td> </tr> </tbody> </table> these attempts:
//tr[starts-with(td/img[contains(@id,'imgpartstatus')])]preceding::(table/tbody/tr/td/span[contains(@id,'idto locate in second portion of xpath')]) //tr[starts-with(td/img[contains(@id,'imgpartstatus')])]sibling::(table/tbody/tr/td/span[contains(@id,'idto locate in second portion of xpath')]) so first portion //tr[starts-with(td/img[contains(@id,'imgpartstatus')])] covered , works fine. need step out of img, td, tr, table, out of div, , in table above. makes sense? thank checking out question.
also, not sure title's "sibling table". may not called way. sorry!
it took bit of time here is:
//div[starts-with(table/tbody/tr/td/img[contains(@id,'imgpartstatus')]/preceding::table[1]/tbody/tr/td/span[contains(@id,'idto locate in second portion of xpath')]
Comments
Post a Comment