Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML code processing

I want to process some HTML code and remove the tags as in the example:

"<p><b>This</b> is a very interesting paragraph.</p>" results in "This is a very interesting paragraph."

I'm using Python as technology; do you know any framework I may use to remove the HTML tags?

Thanks!

like image 872
Laurențiu Dascălu Avatar asked Aug 06 '26 03:08

Laurențiu Dascălu


1 Answers

This question may help you: Strip HTML from strings in Python

No matter what solution you choose, I'd recommend avoiding regular expressions. They can be slow when processing large strings, they might not work due to invalid HTML, and stripping HTML with regex isn't always secure or reliable.

like image 63
Colin O'Dell Avatar answered Aug 08 '26 18:08

Colin O'Dell