Selenium Duplicate Elements marked with ==$0
问题 How to handle duplicate elements in selenium, where duplicate elements comes marked with ==$0 ? Go to www.google.com and search for google search button, I have tried iterator and creating list, but, is this correct way of handling ==$0 driver.findElements(By.xpath("//input[@aria-label='Google Search']")); I want to select second element. 回答1: $0 - $4 The $0 , $1 , $2 , $3 and $4 are the historical reference to the last five DOM elements inspected within the Elements panel of google-chrome