Class PlainText

  • All Implemented Interfaces:
    Selectable
    Direct Known Subclasses:
    Json

    public class PlainText
    extends AbstractSelectable
    Selectable plain text.
    Can not be selected by XPath or CSS Selector.
    Since:
    0.1.0
    Author:
    code4crafter@gmail.com
    • Field Detail

      • sourceTexts

        protected java.util.List<java.lang.String> sourceTexts
    • Constructor Detail

      • PlainText

        public PlainText​(java.util.List<java.lang.String> sourceTexts)
      • PlainText

        public PlainText​(java.lang.String text)
    • Method Detail

      • create

        public static PlainText create​(java.lang.String text)
      • xpath

        public Selectable xpath​(java.lang.String xpath)
        Description copied from interface: Selectable
        select list with xpath
        Parameters:
        xpath - xpath
        Returns:
        new Selectable after extract
      • $

        public Selectable $​(java.lang.String selector)
        Description copied from interface: Selectable
        select list with css selector
        Parameters:
        selector - css selector expression
        Returns:
        new Selectable after extract
      • $

        public Selectable $​(java.lang.String selector,
                            java.lang.String attrName)
        Description copied from interface: Selectable
        select list with css selector
        Parameters:
        selector - css selector expression
        attrName - attribute name of css selector
        Returns:
        new Selectable after extract
      • smartContent

        public Selectable smartContent()
        Description copied from interface: Selectable
        select smart content with ReadAbility algorithm
        Returns:
        content
      • links

        public Selectable links()
        Description copied from interface: Selectable
        select all links
        Returns:
        all links
      • nodes

        public java.util.List<Selectable> nodes()
        Description copied from interface: Selectable
        get all nodes
        Returns:
        result