我需要
在下面的代码片段中提取结尾标记和标记之间的数据:
<td><b>First Type :</b>W<br><b>Second Type :</b>65<br><b>Third Type :</b>3</td>
Run Code Online (Sandbox Code Playgroud)
我需要的是:W,65,3
但问题是这些值也可能是空的,如 -
<td><b>First Type :</b><br><b>Second Type :</b><br><b>Third Type :</b></td>
Run Code Online (Sandbox Code Playgroud)
如果存在其他空字符串,我想获取这些值
我尝试使用nextSibling和find_next('br'),但它返回了
<br><b>Second Type :</b><br><b>Third Type :</b></br></br>
Run Code Online (Sandbox Code Playgroud)
和
<br><b>Third Type :</b></br>
Run Code Online (Sandbox Code Playgroud)
如果标签之间不存在值(W,65,3)
</b> and <br>
Run Code Online (Sandbox Code Playgroud)
我需要的是,如果这些标签之间没有任何内容,它应该返回一个空字符串.