开发者

I have used HTMLEditorKit.facebook source page have 39 <a> tags, but its printing only 8 tags href value.give me some solution for this

for (HTMLDocument.Iterator iterator =
      ((HTMLDocument) doc).getIterator(HTML.getTag(tag));
  开发者_如何学JAVA    iterator.isValid();
      iterator.next()) {

    count++;
    AttributeSet attributes = iterator.getAttributes();
    String src = (String)attributes.getAttribute(HTML.getAttributeKey(attribute));
    if (src != null) {
        System.out.print(attribute + ":" + src);
        System.out.print("\n");
    }       
}


I think source page have more than one tags.HTMLDocument will read from where they opened the HTML tag to where they closed the HTML tag.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜