Package 

Class FeaturedDocument


  • 
    public class FeaturedDocument
    
                        

    A "featured document" is "very important" and the numerical features of each node are calculated, the numerical feature can be used to locate nodes or can be used by machine learning algorithms.

    FeaturedDocument is a wrapper for org.jsoup.nodes.Document, every node's numerical features are calculated by a ai.platon.pulsar.dom.features.FeatureCalculator which can be customized.

    The DOM of a FeaturedDocument is immutable, no method is provided to append or insert elements or nodes.

    FeaturedDocument provides a set of powerful methods to select elements, text contexts, attributes and so on:

    • select: retrieves a list of elements matching the CSS query

    • selectFirst: retrieves the first matching element

    • selectFirstText: retrieves the text content of the first matching element

    • selectFirstAttribute: retrieves the attribute value associated to the given name of the first matching element

    • selectHyperlinks: retrieves all hyperlinks of elements matching the CSS query

    • selectAnchors: retrieves all anchor elements matching the CSS query

    • selectImages: retrieves all image elements matching the CSS query

    Other methods provided include DOM traversal, node counting, document attribute retrieval, export, and so on.

    • Constructor Detail

      • FeaturedDocument

        FeaturedDocument(String baseUri)
        The constructor
        Parameters:
        baseUri - The URL where the HTML was retrieved from.
      • FeaturedDocument

        FeaturedDocument(Document document)