Я предлагаю использовать Jsoup:
Вы можете удалить тег или идентификатор следующим образом:
public void removeUnusedHTMLTags(org.jsoup.nodes.Document document, String tagClassOrId) {
Elements categories = document.select(tagClassOrId);
for (org.jsoup.nodes.Element element : categories){
Log.v(">>>", "Remove unused tag " + tagClassOrId);
element.remove();
}
}
EDIT
Вам необходимо добавить библиотеку Jsoup:
compile 'org.jsoup:jsoup:1.11.3'
Чтобы получить документ:
Connection con = Jsoup.connect(url)
.ignoreContentType(true);
Connection.Response res = con.execute();
String rawJSON = res.body();
Document document = Jsoup.parse(rawJSON);