I want to extract just the inner text 24,000.00 from the following tag:
<span class="itm-price mrs ">
<span data-currency-iso="BDT">৳</span>
<span dir="ltr" data-price="24000">24,000.00</span>
</span>
There are many similar tag like this in the page from where I want to extract data.
I'm trying to do this:
for price in soup.find_all('span', {'class': 'itm-price'}):
item_price = price.get('data-price')
print(item_price)
But Output is coming : None
I learned from the Bs4 doc
that for html5 data-*
tag we should use :
data_soup.find_all(attrs={"data-foo": "value"})
# [<div data-foo="value">foo!</div>]
As I'm very newbie here so I'm still unable to bring resutls using the method.