2021年1月5日星期二

Get text inside a span html beautifulSoup

I have this structure:

<span class="_1p7iugi">  <span class="_krjbj">Price:</span>$39</span>  

and I want to get only the $39, but when I do this code:

def getListingPrice2(listing):      return listing.find("span", {"class":"_1p7iugi"}).text  

It returns me:

Price: $39  

How can I get only the part I want?

https://stackoverflow.com/questions/65589216/get-text-inside-a-span-html-beautifulsoup January 06, 2021 at 10:04AM

没有评论:

发表评论