[Tutor] How to write a loop in python to find HTML tags in a text file

Adam Eyring adameyring at gmail.com
Thu Mar 18 11:11:36 EDT 2021


On Wed, Mar 17, 2021 at 2:20 PM Alan Gauld via Tutor <tutor at python.org>
wrote:

> On 17/03/2021 11:27, S Monzur wrote:
> > Thank you for explaining the process. Might you advise me on how to use
> > beautiful soup on this text file to a) separate the metadata from the
> > bodytext and b) remove all the html tags
>
> I don't have BS installed at present. Maybe someone who
> does can contribute a solution?
>
>
I don't work with Beautiful Soup, but this chapter in the free PDF book
Automate the Boring Stuff with Python may help:
https://automatetheboringstuff.com/2e/chapter12/

bs4 is the Beautiful Soup module.

AME


More information about the Tutor mailing list