Oct-28-2023, 03:58 PM
When use
.text
to get content out of tag it will be ok.from bs4 import BeautifulSoup html = '<strong>Clamps P&S Black 100</strong>' soup = BeautifulSoup(html, 'lxml') tag = soup.select_one('strong')
>>> tag <strong>Clamps P&S Black 100</strong> >>> tag.text 'Clamps P&S Black 100'