Capture an attribute of the span-class (HTML)

I am trying to pull the price of an item from a site. I can get the title of the item but cant seem to get the price.

Attached is what I have so far. How can i get the “content” attribute?

Code:

$data = invoke-webrequest -uri "https://www.homedepot.com/p/Kwikset-Tustin-Satin-Nickel-Privacy-Bed-Bath-Door-Lever-730TNL-15-6AL-RCS/202106308?keyword=734509&semanticToken=20330000111_20200116123136340521_x6z5+20330000111+%3E++cnn%3A%7B11%3A0%7D+cnr%3A%7B7%3A0%7D+cnd%3A%7B4%3A0%7D+cne%3A%7B8%3A0%7D+cnb%3A%7B0%3A0%7D+cns%3A%7B5%3A0%7D+cnx%3A%7B3%3A0%7D+st%3A%7B734509%7D%3Ast+oos%3A%7B0%3A1%7D+dln%3A%7B562872%7D+qu%3A%7B734509%7D%3Aqu"

$data.ParsedHtml.all.tags("h1") | ForEach-Object -MemberName innertext

$data.ParsedHtml.getElementById("ajaxPrice") | ForEach-Object -MemberName innertext  #this works but no period between the dollar and cents -- and acts as three separate data point

Hi,

This works for me:

$data.ParsedHtml.getElementById("ajaxPrice").getAttribute("content")
28.97

Regards,

Stuart.

thanks, this worked! I think I was forgetting the “get” in getAttribute when I was doing this earlier.