I have this DOM elelement, where the part of the name of the menu [ v15rco8kc2 ] is changing for every call of the document. How Could I use a joker in the QuerySelector?
document.querySelector("#menu-v15rco8kc2 > div:nth-child(1) > button > span.Typography-module__lVnit.Typography-module__Nfgvc.Button-module__Imdmt")
Using CSS selectors, you cannot use a wildcard directly to match part of an attribute value. You can use
attribute selectorsto match elements based on a partial attribute value.Demo: