Is it possible to use regex on Selectors?

Good morning everybody!

I want to select multiple elements with slightly different id, as follows:
<div id="wrapper_1"></div>
<div id="wrapper_2"></div>
<div id="wrapper_3"></div>

Is there a way to select them by adding a selector such as div#wrapper_[*] or something that would account for this difference in part of the string?

I know it is possible to scrape through multiple pages just by adding the range and step through the following syntax:

https://targetwebsite.com/page=[0-30:10]

Which will produce:
https://targetwebsite.com/page=0
https://targetwebsite.com/page=10
https://targetwebsite.com/page=20
https://targetwebsite.com/page=30

I am looking for something similar on Selectors, however.

Yea, there are a few CSS selectors that have "wildcard" features.
2020-08-29_102346

For your example, you can try:
div[id^='wrapper_']

Refs:
https://www.w3schools.com/cssref/css_selectors.asp

1 Like

That is exactly what I was looking for. Thanks!!