I am trying to click on an item whose xpath is:
//*[@id="single-71048602500"]/div[2]/div[1]
There are more elements that start with //*[@id="single"]
, and the number changes each time the page loads. So the only specific bits are the combination of "single" and /div[2]/div[1].
The CSS_selector has the number as well, so it is of no use.
What would the code to select the element be?
I'm using Python and Selenium.
Try this xpath and let me know how it goes.
(//*[contains(@id,"single")]/div[2]/div[1])[index of an element ]
The below xpath will help you to find all the element which is contains id values as single
//*[contains(@id,"single")]/div[2]/div[1]