1 html = """
2
The Dormouse's story3
4
The Dormouse's story
5
Once upon a time there were three little sisters; and their names were
7 Lacie and
8 Tillie;
9 and they lived at the bottom of a well.
10
...
11 """
我们在写 CSS 时,标签名不加任何修饰,类名前加点,id名前加 #,在这里我们也可以利用类似的方法来筛选元素,用到的方法是 soup.select(),返回类型是 list
(1)通过标签名查找
print soup.select('title')
<