i am using Selenium library and python. On page i got multiple offers, every has same beginning of the link https://www.example.com/offer/.... And same classes, but the problem is i couldn't find element which has more than one class. It also has the same attribute "data-cy"
I tried
offerName = driver.find_element_by_xpath("//a[contains(@class, 'marginright5') and contains(@class, 'link') and contains(@class, 'linkWithHash') and contains('detailsLink')]")
But it didn't worked because of this error
selenium.common.exceptions.InvalidSelectorException: Message: Given xpath expression "//a[contains(@class, 'marginright5') and contains(@class, 'link') and contains(@class, 'linkWithHash') and contains('detailsLink')]" is invalid: [Exception... "<no message>" nsresult: "0x8060000d (<unknown>)" location: "JS frame :: chrome://marionette/content/element.js :: element.findByXPath :: line 387" data: no]
How i can find them?