For web scraping with BeautifulSoup, I want to get the second span value "Tk 2,050".
html
<p class="book-price">
<strike class="original-price pl-2">TK. 2,300</strike>
<span>TK. 2,050</span> </p>
I have tried the below code.
prices = soup.find("p",class_ ="book-price")
It returns "TK. 2,300 TK. 2,050"
I only want the span value. How can I implement it? thanks.
source https://stackoverflow.com/questions/75979925/how-to-add-multiple-attributes-in-beatifulsoup-to-get-html-element
Comments
Post a Comment