I'm having a hard time trying to get rid of all the extra HTML tags within the text I scraped from a certain web page, however, str.replace()
in Python doesn't seem to be working for targets like <br>
and =
, while other tags such as <li></li>
will be successfully replaced.
Here's my code.
str(txt).replace('<li>', '')
.replace('</li>', '')
.replace('<ol>', '')
.replace('</ol>', '')
.replace('<br>', '')
.replace('=', '')
Any advice will be much appreciated.