简体   繁体   中英

Removing html tags from a website using python code

I would like to know how to remove HTML tags from a given website using python. I want to be able to output all the text within a html page excluding all the HTML code

Try Beautiful Soup . Then you can get all stripped text by simply:

soup.get_text()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM