I'm trying to scrape div, which has dynamically generated class name.
class_name_1234 class_name_2345 class_name_3456
Can you help me please? Is there any possibility to choose by querySelector even those classes which can be identified only by the common beginning of the name?
Thank you
CodePudding user response:
You're looking for a CSS selector that lets you search for an attribute that begins with a specific string:
[attribute^=value]
In your case:
[class^="class_name_"]
More info: https://www.w3schools.com/cssref/sel_attr_begin.asp