import bs4
for cell in [
'<html>The indicator lights on the control cabinet are to be replaced with 24Vdc LED\'s. 3 Red & 3 Green.</html>',
'<html><div> <span style=""FONT-SIZE: 18pt"">Close the Monthly LAD and Lanyard Work orders to show they were executed. </span></div>']:
print(bs4.BeautifulSoup(cell).text.strip())
结果:
The indicator lights on the control cabinet are to be replaced with 24Vdc LED's. 3 Red & 3 Green.
Close the Monthly LAD and Lanyard Work orders to show they were executed.
在终端中,
pip install bs4
。然后可以使用python提取文本,如下所示:结果:
相关问题 更多 >
编程相关推荐