from bs4 import BeautifulSoup
soup = BeautifulSoup(content, 'html.parser')
overview = soup.text[0:9]
print(overview)
from bs4 import BeautifulSoup
soup = BeautifulSoup(content, 'html.parser')
print(soup) # 這裏帶有script標籤的腳本
for tag in soup.find_all():
if tag.name in ['script', 'link']:
tag.decompose()
print(soup) # 這裏已經把帶有script標籤的腳本去掉了