假设我们有代码:
<tr class=" " somethingc1="" somethingc2="" somethingc3="" data-something="1" something="1something4" something_id="6something7">
<td class="text-center td_something">
<div>
<span doo="true" class="foo" style="left:70%;z-index:99;">
<span doo="true" class="foo" style="left:50%;z-index:90;">
<span doo="true" class="Kung foo" style="left:90%;z-index:95;">
</div>
</td>
</tr>
<tr class=" " somethingc1="" somethingc2="" somethingc3="" data-something="1" something="1something4" something_id="6something7">
<td class="text-center td_something">
<div>
<span doo="true" class="Kung foo" style="left:35%;z-index:95;">
</div>
</td>
</tr>
<tr class=" " somethingc1="" somethingc2="" somethingc3="" data-something="1" something="1something4" something_id="6something7">
<td class="text-center td_something">
<div>
<span doo="true" class="foo" style="left:99%;z-index:100;">
</div>
</td>
</tr>
如何在 Python 中使用 Bs4 制作列表以在“样式”属性中找到“左”的最高值,记住我不想考虑跨度与 class_“Kung”
期望的结果是:
[70,False or NaN,99]
我已经知道了,我应该从以下内容开始:
trs = soup.find_all('tr', attrs={"data-something": "1"})
List = list()
find_all('span',{'style': re.compile(r'^left:.')})