Unable to find xpath using position(), last(),[1] indexing([1]--eg.) following:siblings, child, parent



  • I am trying to find out the XPATH. I am getting 30 matches for an element.

    I tried using last(), position(), indexing[], child, parent, following:siblings, preceding:siblings, absolute XPATH is also not working, how to achieve this.



  • You're on the right track, but I've only recently discovered myself the solution to this type of problem. Surround the main xpath with parenthesis, place the subscript AFTER.

    Assuming that your basic xpath is correct, the following should isolate element 1:

    (//span[@class='cursor']//*[local-name()='svg'][@class='excel-document'])[1]
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2