import re
import requests
from bs4 import BeautifulSoup
r = requests.get('http://www.jxufe.edu.cn')
html = r.text
soup = BeautifulSoup(html)
text = soup.get_text() #获取标签内文字
text_final = re.sub('\n+',' ',text) #将一个或多个换行符替换为空格
详见代码注释