Given an example html string
<table>
<tr>
<td class="td" height="25">Upstream Power</td>
<td class="td">25.2 dBmV</td>
<td class="td">49.2 dBmV</td>
</tr>
</table>
I can find text using:
soup.find_all(text=re.compile("Power"))
But to find the entire tag doesn’t find anything. What am I missing?
soup.find_all("td",text=re.compile("Power"))
In BS3, the method is
findAllnotfind_all:Edit: I see that the method was renamed in BS4. It seems to work OK for me:
Edit2: To make navigating the parse tree easier, you can use tag names: