我正在尝试检查是否在表格中找到了数值。为什么这段代码在这个表中找不到数字文本“699”?print 语句给出的值为“None”。
html = """
<table>
December 31, 1997 1996 1995 1994 1993
Allowance for credit losses--loans 699 773
Allowance for credit losses--
trading assets 285 190
Allowance for credit losses--
other liabilities 13 10
- --------------------------------------------------------------------------------
Total $ 997 $ 973 $ 992 $1,252 $1,324
================================================================================
</table>
"""
soup = BeautifulSoup(''.join(html))
table = soup.find('table')
test = table.find(text='699')
print test