BeautifulSoup是一个HTML或XML的解析器,简单来说,就是可以在网页源代码中提取想要的信息。下面是一些基础操作~
先给一段源代码素材
html = """
<html><head><title>The Dormouse's story</title></head>
<body>
<p class="title" name="dromouse"><b>The Dormouse's story</b></p>
<p class="story">Once upon a time there were three little sisters; and their names were
<a href="http://example.com/elsie" class="sister" id