BeautifulSoup

BeautifulSoup对象表示的是一个文档的全部内容.大部分时候,可以把它当作Tag对象,它支持遍历文档树搜索文档树中描述的大部分的方法.

因为BeautifulSoup对象并不是真正的HTML或XML的tag,所以它没有name和attribute属性.但有时查看它的.name属性是很方便的,所以BeautifulSoup对象包含了一个值为 “[document]” 的特殊属性.name

soup.name
# u'[document]'

results matching ""

    No results matching ""