简体   繁体   English

如何在 BeautifulSoup 中使用 Python 仅打印这一行的日期?

[英]How do I print only the date from this line using Python in BeautifulSoup?

<td colspan="6" style="background-color: #fff;text-align: center;font-weight:bold;">Draw Date:  2019-01-15</td>

How do I print only the 2019-01-15 part?如何仅打印2019-01-15部分? This value is stored in the date variable.该值存储在date变量中。

date.string.split()[-1]
#'2019-01-15'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM