我有一个完整的 HTML 字符串。它看起来像这样:
<html>
<head>
</head>
<body>
This is a test
<img width=403 height="302" id="someid1" src="http://mysite.com/images1">
<img width="456" height=300 src="http://mysite.com/images2" id="someid2">
</body>
</head>
我想做的是清理源头。我只想删除 img 标签中的所有宽度和高度。我想保留 ID 和 SRC 属性。