I am facing an issue with a webpage that contains either of the following:
<span id='size'>33</span>
Or
<span id='size'>
<b>33</b>
<strike>32</strike>
</span>
I need to extract the value '33' in both scenarios. Is there a CSS selector that can achieve this? I attempted to use the following code for selecting #size without a sibling b or a b that is a sibling of #size:
document.querySelector('#size:not(>b), #size>b').innerText
However, I keep encountering an error- "Error: SYNTAX_ERR: DOM Exception 12"
As per the w3 Spec, only Simple Selectors are supported. The problem lies in the fact that the "greater-than sign" (U+003E, >) is considered part of the definition of Simple Selectors.