【发布时间】:2021-09-07 23:48:50
【问题描述】:
我需要从 srt 文件中的对话框中提取标签和文本,例如:
'<b><font color="#ca6500">FEMALE VOICE:</font></b> <i>The world is changed.</i>'
我想得到:
['<b>', '<font color="#ca6500">', 'FEMALE VOICE:', '</font>', '</b>', ' ', '<i>', 'The world is changed.', '</i>']
我们将不胜感激。
【问题讨论】:
-
我强烈推荐在这里使用 HTML 解析器。可以使用
beautifulsoup模块吗?