'click on href without id or class cypress

I'm trying to click an href element using cypress I've wondered if I can access it by its content ex:

<a href=example.com>CONTENT</a>

but I couldn't find anything online.

I've tried using something like that:

cy.get('a[href*="url"]').click()

but it also didn't work



Solution 1:[1]

You can use contains with selector and text something like:

cy.contains('a', 'CONTENT').click()

Solution 2:[2]

Did you add your first logo as static splash image ?. Static splash image will be shown while the engine is loading

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alapan Das
Solution 2 Hasitha Jagoda