[ 
https://issues.apache.org/jira/browse/NUTCH-1250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13562577#comment-13562577
 ] 

Julien Nioche commented on NUTCH-1250:
--------------------------------------

See comment in DOMContentUtils

{quote}
   * Links without inner structure (tags, text, etc) are discarded, as
   * are links which contain only single nested links and empty text
   * nodes (this is a common DOM-fixup artifact, at least with
   * nekohtml).
{quote}

the solution you suggested would probably generate quite a lot of noise by not 
filtering the links added by Neko. I agree that outlinks without anchors should 
not be filtered. What about testing that they have a href attribute instead of 
testing for the presence of a child node?


                
> parse-html does not parse links with empty anchor
> -------------------------------------------------
>
>                 Key: NUTCH-1250
>                 URL: https://issues.apache.org/jira/browse/NUTCH-1250
>             Project: Nutch
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.4
>            Reporter: Andreas Janning
>             Fix For: 1.7, 2.2
>
>         Attachments: DOMContentUtils_v1.patch
>
>
> The parse-html plugin does not generate an outlink if the link has no anchor
> For example the following HTML-Code does not create an Outlink:
> {code:html} 
>   <a href="example.com"></a>
> {code}
> The JUnit-Test TestDOMContentUtils tries to test this but fails since there 
> is a comment inside the <a>-Tag.
> {code:title=TestDOMContentUtils.java|borderStyle=solid}
> new String("<html><head><title> title </title>"
>         + "</head><body>"
>         + "<a href=\"g\"><!--no anchor--></a>"
>         + "<a href=\"g1\"> <!--whitespace-->  </a>"
>         + "<a href=\"g2\">  <img src=test.gif alt='bla bla'> </a>"
>         + "</body></html>"), 
> {code}
> When you remove the comment the test fails.
> {code:title=TestDOMContentUtils.java Test fails|borderStyle=solid}
> new String("<html><head><title> title </title>"
>         + "</head><body>"
>         + "<a href=\"g\"></a>" // no anchor
>         + "<a href=\"g1\"> <!--whitespace-->  </a>"
>         + "<a href=\"g2\">  <img src=test.gif alt='bla bla'> </a>"
>         + "</body></html>"), 
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to