You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/01/05 22:10:00 UTC

[jira] [Commented] (NUTCH-2634) Some links marked as "nofollow" are followed anyway.

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

ASF GitHub Bot commented on NUTCH-2634:
---------------------------------------

sebastian-nagel opened a new pull request, #751:
URL: https://github.com/apache/nutch/pull/751

   - fix detection of nofollow in multi-valued rel attributes in parse-html and parse-tika
   - add unit tests to prove solution




> Some links marked as "nofollow" are followed anyway.
> ----------------------------------------------------
>
>                 Key: NUTCH-2634
>                 URL: https://issues.apache.org/jira/browse/NUTCH-2634
>             Project: Nutch
>          Issue Type: Bug
>            Reporter: Gerard Bouchar
>            Priority: Major
>             Fix For: 1.20
>
>
> In order to check if an outlink in an <a> tag can be followed, nutch checks whether the value of its rel attribute is the exact string string "nofollow".
> However, [the rel attribute can contain a list of link types|https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-rel], all of which should be respected.
> So nutch rightfully doesn't follow a link like:
> {code:html}
> <a href='top-secret.html' rel="nofollow">DO NOT FOLLOW THIS LINK</a>
> {code}
> but wrongfully follows :
> {code:html}
> <a href='top-secret.html' rel="nofollow noreferrer">DO NOT FOLLOW THIS LINK</a>
> {code}
> Because of the code duplication in nutch's html parsers, this should be fixed in two places:
> # [parse/html/DOMContentUtils.java|https://github.com/apache/nutch/blob/3ada351a26b653b307c19e25b17e0e611a9bd59a/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/DOMContentUtils.java#L437]
> # [parse/tika/DOMContentUtils.java|https://github.com/apache/nutch/blob/f02110f42c53e77450835776cf41f22c23f030ec/src/plugin/parse-tika/src/java/org/apache/nutch/parse/tika/DOMContentUtils.java#L410]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)