Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果 Beautiful Soup 给了我这样的锚标签:
<a class="blah blah" id="blah blah" href="link.html"></a>
我将如何检索href属性的值?
href
如果您已经有了锚点,请href像这样获取属性:
href = anchor["href"]
link.get('href')
其中“链接”是您的“a”标签的名称