import requests
from bs4 import BeautifulSoup
x = requests.get('http://www.jxufe.edu.cn/')
a=x.text
soup=BeautifulSoup(a)
b=soup.get_text()
c=b.replace('\n', '')
print(c)
b为运用BeautifulSoup模块中的get_text功能提取出代码中的所有文字内容。 c为将b内容中的换行符用replace函数除去之后得到的内容。