Click image with specific attribute value

My robot is searching for book titles on Amazon using data from a CSV file. It is assumed that the first product on the results list will be the product that the robot is looking for. The first product image on the list has an attribute value of: image data-image-index=“0” … The second would be image data-image-index=“1” and so on.

How can I get my robot to click the image with data-image-index=“0”? I assume I do it with selectors. I can’t use the record feature and manually click the first result because the search results are dynamic. Having difficulty finding information on how to manually write a selector that would do this.


@Automaton, try Anchor Base

Hi asumitd,

Would you be able to explain a bit more? What anchor action should I be using? I can’t just use “Find Element” or it will create a selector that’s looking for a specific image. It’s also saying the selector is invalid.