【发布时间】:2018-03-05 19:39:44
【问题描述】:
如何找到具有特定类名的li 标签而不是其他标签?例如:
...
<li> no wanted </li>
<li class="a"> not his one </li>
<li class="a z"> neither this one </li>
<li class="b z"> neither this one </li>
<li class="c z"> neither this one </li>
...
<li class="z"> I WANT THIS ONLY ONE</li>
...
代码:
bs4.find_all ('li', class_='z')
返回多个条目,其中有一个 "z" 和另一个类名。
如何单独找到类名"z"的条目?
【问题讨论】:
标签: python beautifulsoup