:contains("String") selector with 2 possible matches

Hello,
I am scraping a site (https://www.youtube.com/c/poatv/videos) that displays videos with publication date information expressed as "n days ago", or "n weeks ago" ...
I want to apply my scraping only for videos published 11 month ago or 1 year ago
I do succeed to get these videos separately using :contains("11 month") for one sitemap and using :contains("1 year") for another sitemap.

I want to define only one sitemap but I do not know how to apply a Or with the Contains selector to get videos that contains "11 month" or "1 year"

Can anyone help me

Thank you

You can have multiple selectors just by separating them with a comma. This works like an Or condition, e.g.:

div:contains("11 month"),div:contains("1 year")

Thanks a lot for your reply, it answers exactly to what I need to do.

1 Like