其中有一个字符串,其中包含许多html标签,如以下内容,u'find /home/tiger/workspace -name "[0-9]*"<br />find /home/tiger/workspace -name "[!0-9]*"<br />find /home/tiger/workspace -name "[^0-9]*"<br /><br />\u627e\u51fa\u6240\u6709\u5305\u542b\u6570\u5b57\u7684\u6587\u4ef6\uff0c\u4e0d\u5305\u542b\u6570\u5b57\u7684\u6587\u4ef6\u3002<br />tiger@debian:~$ find /home/tiger -name "*[0-9]*" >kan1<br />tiger@debian:~$ find /home/tiger -name "[0-9]*" >kan2<br />tiger@debian:~$ find /home/tiger -name "*[0-9]" >kan3<br /><br /><br />\u5305\u542b\u6570\u5b57\uff0c\u6570\u5b57\u5f00\u5934\uff0c\u6570\u5b57\u7ed3\u5c3e'
如何才能获得字符串中的纯文本来删除html标签?
使用html2text库:
请参阅Extracting text from HTML file using Python以获取参考。在
相关问题 更多 >
编程相关推荐