BeautfilSoup()接受哪些参数来创建BeautifulSoup对象?

2024-04-24 00:28:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我怎么知道BeautifulSoup()接受httpResponse对象,当BeautifulSoup文档没有提到它接受httpResponse对象时,urlopen()会返回该对象?你知道吗

有人能详细说明一下BeautifulSoup()接受的参数类型的范围吗?你知道吗

from bs4 import BeautifulSoup
from urllib.request import urlopen

html = urlopen("http://en.wikipedia.org/wiki/Kevin_Bacon")
soup = BeautifulSoup(html, 'html.parser')

Tags: 对象from文档importhttp类型参数request