我想从html文件中删除标签....但只包含具有特定属性的标签。
例如,我可能有以下代码:
<span class = 'A'>This is the first sentence.</span><span id = 'B'>This is the second sentence</span>
我想删除所有出现的<span id = 'B'>
,结果如下
<span class = 'A'>This is the first sentence.</span>This is the second sentence
有什么想法吗?