BeautifulSoup - 提取属性值

db9*_*b90 10 python beautifulsoup

如果Beautiful Soup给我一个这样的锚标记:

<a class="blah blah" id="blah blah" href="link.html"></a>
Run Code Online (Sandbox Code Playgroud)

我该如何检索href属性的值?

And*_*are 10

如果您已经拥有锚点,请抓住以下href属性:

href = anchor["href"]
Run Code Online (Sandbox Code Playgroud)