How to choose selector when it changes every time the page reloads

I want to scrape some data from https://insighttimer.com/meditation-topics/naturesounds/browse/music .

The links has the following ID <a href= "blah" class="some text 356". When I reload the page, the class changes to "some text 1099" and so on. Every time some random number gets appended to the class ID. Hence I am not able to scrap data since the class ID change every time on website refresh. Anyway, how to deal with this? thanks

Sure, you can use either the "starts with" (^) or "contains" (*) CSS selectors, or you can also use another attribute which doesn't change e.g.:

a[class*='some class text which does not change']
or
a[role='button']

Ref: CSS Selector Reference

2 Likes

Thanks a ton!Had wasted lot of time earlier on this

Thanks a once again Leemeng !!