完成下面用从标签中取出文本内容程序填空: 输入答案 bs4 import BeautifulSoup fp = open('test1.html', 输入答案 = 'utf-8') soup = BeautifulSoup(fp, 'lxml') 输入答案 (soup.find(class_ = 'first')['class'])
时间: 2023-08-13 08:09:05 浏览: 79
BS4_BeautifulSoup.docx
下面是填空后的代码:
```python
import bs4
from bs4 import BeautifulSoup
fp = open('test1.html', encoding = 'utf-8')
soup = BeautifulSoup(fp, 'lxml')
print(soup.find(class_ = 'first')['class'])
```
阅读全文