見出しが始まる前にすべての画像タグを削除したいのですが、同じようにネストされていません。次に、空のタグを削除します。
<div class="c2">
<img src="image/file" width="480" height="360" alt="Image" />
</div>
<div class="c2">
<div class="headline">
headline
</div>
<div class="headline">
headline2
</div>
</div>
のようなさまざまなネストされたタグ
<div class="c2">
<p>
<img src="image/A.JPG" width="480" height="319" alt="Image" />
</p>
<div class="headline">
A headline
</div>
</div>
再帰的に解決できると思いますが、方法がわかりません。
ご協力いただきありがとうございます!