I'm having trouble getting the exact price off of this html code :
<span id="price" data-selenium-price="1094.4">$1,094.40</span>
Below is what I used to get the exact price but it resulted in the value 1
rather than the value 1094.4
:
function() {
try {
return document.querySelector("#price").innerText.match(/^.{1}(.*).{0}/i)[1].trim();
}
catch(e) {
return "";
}
}
I'm not quite sure what I can do? Any help would be appreciated.