Cat and dog

' or '

Cat and dog

' or '

Cat and dog

' or '

Python oneliner to remove tags from chuncks of HTML codes

23 Views Asked by At

I have a datafile with chunks of HTML code that look like this:

'<div data-schema-version="8"><p>Cat and dog</p> </div>'

or

'<div data-citation-items="cite" data-schema-version="8"><p>Car</p> </div>'

Is there a simple way to strip these lines from all tags getting the text only like "Cat and dog" and "Car", simpler than using BeautifulSoup?

0

There are 0 best solutions below