0

Im getting 1 match with the fist xpath but 0 with the latter

I tried extracting an anchor tag using selenium by xpaths.

1 Answers1

0

DIFFERENCE:

(//a[@class="_2whKao"])[3] - This expression tries to locate the 3rd element(from the top) in the DOM.

//a[@class="_2whKao"][3] - This expression tries to locate the element(s) who are the 3rd child of their parent node.

Refer this - https://stackoverflow.com/a/4008925/7598774

Shawn
  • 4,064
  • 2
  • 11
  • 23