开发者

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

开发者 https://www.devze.com 2023-03-31 13:00 出处:网络
for (HTMLDocument.Iterator iterator = ((HTMLDocument) doc).getIterator(HTML.getTag(tag)); 开发者_如何学JAVAiterator.isValid();
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

精彩评论

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