from bs4 import BeautifulSoup
import re
soup = BeautifulSoup('<root><td><label for="pol_nbr">Policy number<br></label></td></root>', 'html.parser')
anchor = soup.find('label', text=re.compile('Policy number'))
anchor
is none. Why is it not the label
tag?