制作了一个解析器,显示来自网站的经文文本:https :
//stihibase.ru/author/t/tjutchev/vesennjaja_groza/ 但是,除了文本之外,它还显示 block-poema-left-control 并写入:“按主题和作者”。我需要删除它
from bs4 import BeautifulSoup
import pandas as pd
url = 'https://stihibase.ru/author/t/tjutchev/vesennjaja_groza/'
response = requests.get(url)
bs = BeautifulSoup(response.text,"lxml")
temp = bs.find('article', 'block-poema')
print(temp.text)
1 个回答