There are times where we need to find the nth element after a parent element on the page. In the XPath examples, we looked at the second input after the
div with the class
leftdiv. The XPath looked like this:
xpath=//div[@class='leftdiv']/input. To find the second to nth element we will need to use pseudo classes. Pseudo classes are used to add special effects to selectors. In this case we are going to use
:nth-child for the first example.
css=div#divinthecenter *:nth-child(3). This will find the same as
Unfortunately Selenium ...