Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
javax-swing-html解析器未拾取img标记_Java_Html_Swing_Html Parsing - Fatal编程技术网

javax-swing-html解析器未拾取img标记

javax-swing-html解析器未拾取img标记,java,html,swing,html-parsing,Java,Html,Swing,Html Parsing,此HTML: <td height="79" valign="top" width="70"> <a href="http://e.livinghuntington.com/HS?a=stuff" target="_blank" title="Follow us on Twitter: http://twitter.com/#!/HuntingtonLive"> link link link <img alt="Follow us on Tw

此HTML:

<td height="79" valign="top" width="70">
            <a href="http://e.livinghuntington.com/HS?a=stuff" target="_blank" title="Follow us on Twitter: http://twitter.com/#!/HuntingtonLive"> link link link <img alt="Follow us on Twitter: http://twitter.com/#!/HuntingtonLive" border="0" height="79" src="http://webe.emv3.com/livinghuntington/images/tt.png" style="display:block;" width="70"/></a>
        </td>
</table>
<table>
给出此输出:

tag = td
tag = a
tag = table

我尝试了各种测试策略:如果我嵌套了一个链接(我甚至不知道它是否是有效的html),它会正确地拾取内部链接。如果我把图片从链接中拉出来,它仍然不会拾取img。据我所知,它从来没有拿起任何图像标签。代码中是否有错误或混乱,或者这是HTML解析器无法修复的问题(因此我需要丢弃它并使用新的解析器)?

问题是img是简单的标记,因此在startTag()下没有拾取。handleSimpleTag()是要使用的处理程序。

这是您的问题吗?有什么好处?Java的HTMLEditorKit不是完美的——事实上也不是完美的,这就是为什么它会选择任何其他自动关闭标记?请尝试在结尾不使用/的情况下使用
。否。自动关闭/打开-关闭的所有4种组合以及img/src设置均失败。它在“>上拾取tag=a,这似乎与@ControlAltDel的评论一致,即它是一个垃圾解析器。也许我的img标记不够好,它无法拾取。
tag = td
tag = a
tag = table