from bs4
import BeautifulSoup
soup
= BeautifulSoup
(article_content
,"html.parser")
desc
= soup
.text
+"..."
for tag
in soup
.find_all
():
if tag
.name
in ["script", "link"]:
tag
.decompose
()
soup
.prettify
()
转载请注明原文地址: https://mac.8miu.com/read-494359.html