Answer the question
In order to leave comments, you need to log in
How to remove tags from text that has been parsed?
I am writing a parser, one section consists of blocks, they are parsed, but there is a . I can't remove these tags, replace doesn't help, what can I do? Here is the code:<р> </р>
def get_content(text: str):
soup = bs4.BeautifulSoup(text, 'lxml')
items = soup.find_all('div', itemtype="http://schema.org/Product")
things = []
for item in items:
try:
discr = item.find('div', id='full_description').findAll('p')[:-1]
except:
discr = ''
for i in discr:
discr += i
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question