我想提取链接(https://link.springer.com/chapter/10.1007/978-3-319-91662-0_20)中存在的论文的摘要文本。 如何用python获得?
到目前为止,我已经有了这段代码,但是我不知道下一步要做什么
import urllib.request
url = "https://link.springer.com/chapter/10.1007/978-3-319-91662-0_20"
uf = urllib.request.urlopen(url)
html = uf.read()
我找到了。
import requests
from bs4 import BeautifulSoup
url = "https://link.springer.com/chapter/10.1007/978-3-319-91662-0_20"
html = requests.get(url).text
soup = BeautifulSoup(html)
elem = soup.body.find('section', attrs={'class':'Abstract'}).text
print()
print(elem)