css selector for dynamic MuiButton-label
I am trying to find a selector for this date element, it is found as MuiButton-label but the date text is dynamic, I can locate using the xpath in the playwright code but looking for a way to locate it using a css selector. Appreciate your time and help.
Solution – 1
Try this selector:
Explanation of selector:
.MuiButton-label: An element with class "MuiButton-label"
span: Sub elements of previous element with tag "span"
:nth-child(2): We will get 2 span, so we get the second one
Solution – 2
could locate the element with this selector
button >> nth=3>>span>span:nth-child(2)