Element exist fails on same website dependent on searched product number

I have a data scraping tool that depending on whether or not website has opened the alternative product field needs to make a click function before data scraping. To do this I would use an Element exist, so if the alternative product field is closed the search looks like this and I want UIpath to click “Tilsvarende varenumre”

When it is open it will look like this, and I want it to check if the yellowed out field exist, if it does, then just make the data scrape if it doesn’t push “Tilsvarende varenumre” then do the data scrape.

This should work and works on other projects i’m working on, but no matter which part of the alternative product field I choose, it sometimes find it’s but with other searches it doesn’t.

Any ideas to how I can fix this?


How does your selector look like? Maybe you can optimize it. My advice is to check “class” and “parent-class” and avoid “id”. This works fine for me!

Good luck