题目内容

Python中BeautifulSoup模块的功能是?

A.从网页抓取数据
B.生成一个漂亮的汤
C.科学计算
D.人工智能

查看答案
更多问题

在Python中,如何安装BeautifulSoup模块

A.sudo apt install beautifulsoup4
B.sudo yum install beautifulsoup4
C.pip3 install beautifulsoup4 --user
D.pip3 start beautifulsoup4

在安装完BeautifulSoup模块后,如何导入它?

A.import BeautifulSoup4
B.from bs4 import BeautifulSoup
C.import BeautifulSoup
D.from BeautifulSoup import *

现有一个定义好的BeautifulSoup对象soup = BeautifulSoup(html,'lxml'),需要得到html中的标签可以使用什么语句?

A.soup.tag.title
B.soup.getTag("title")
C.soup.get("title")
D.soup.title

现有一个定义好的BeautifulSoup对象soup = BeautifulSoup(html,'lxml'),如何格式化html?

A.soup.prettify()
B.soup.pretty()
C.prettify(soup)
D.pretty(soup)

答案查题题库