Here is a code snippet I need help with:
<colored-item label="Label A" symbol-size-left="9.5" symbol-size-right="12" symbol-right="" symbol-left="<svg viewport="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<rect x="0" y="0" width="24" height="24" stroke="black" fill="rgb(0, 91, 142)" stroke-width="0" />
</svg>" small-font="true"></colored-item>
I'm trying to extract the value of the "fill" attribute (which is "rgb(1, 89, 138)").
So far, I've attempted the following:
const fillColor = await Selector('colored-item').getAttribute('symbol-left');
This returns:
<svg viewport="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<rect x="0" y="0" width="24" height="24" stroke="black" fill="rgb(1, 89, 138)" stroke-width="0" />
</svg>
When I tried
const fillColor = await Selector('colored-item').withAttribute('symbol-left').getAttribute('fill');
the result was "null"
Does anyone have a solution to directly access the "fill" attribute?
Otherwise, would I need to resort to using regex?