I have the following markup:
<div >
<fin-streamer data-symbol="TSLA" data-test="qsp-price" data-field="regularMarketPrice" data-trend="none" data-pricehint="2" value="860" active="">860.00</fin-streamer>
<fin-streamer data-symbol="TSLA" data-test="qsp-price-change" data-field="regularMarketChange" data-trend="txt" data-pricehint="2" value="-44.549988" active=""><span >-44.55</span></fin-streamer>
<fin-streamer data-symbol="TSLA" data-field="regularMarketChangePercent" data-trend="txt" data-pricehint="2" data-template="({fmt})" value="-0.049250998" active=""><span >(-4.93%)</span></fin-streamer>
<fin-streamer data-symbol="TSLA" changeev="regularTimeChange" data-field="regularMarketTime" data-trend="none" value="" active="true"></fin-streamer>
<fin-streamer data-symbol="TSLA" changeev="marketState" data-field="marketState" data-trend="none" value="" active="true"></fin-streamer>
<div id="quote-market-notice" ><span>At close: February 11 04:00PM EST</span></div>
</div>
I am trying to get to the price value, which is the first value in the <fin-streamer>
element tag.
I am able to select the parent div, using this selector:
['//div[@]
However, once selected, it is not clear how to select the non standard tag element <fin-streamer>
and on to the price field.
How do I extract the price field?
CodePudding user response:
If I understand you correctly, this expression
//div[@]/fin-streamer[@data-test="qsp-price"]/text()
should output
860.00