Class LightweightHtmlPageUtils


  • public class LightweightHtmlPageUtils
    extends BasicPageUtils
    The LightweightHtmlPageUtils class provides some convenience methods for dealing with unparsed HTML pages, i.e. with strings containing the page's HTML source.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> getAllAnchorLinks​(java.lang.String page)
      Returns the values of the "href" attribute of all "a" tags on the page as a list of strings.
      static java.util.List<java.lang.String> getAllImageLinks​(java.lang.String page)
      Returns the values of the "src" attribute of all "img" tags on the page as a list of strings.
      static java.util.List<java.lang.String> getAllLinkLinks​(java.lang.String page)
      Returns the values of the "href" attribute of all "link" tags on the page as a list of strings.
      static java.util.List<java.lang.String> getAllScriptLinks​(java.lang.String page)
      Returns the values of the "src" attribute of all "script" tags on the page as a list of strings.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LightweightHtmlPageUtils

        public LightweightHtmlPageUtils()
    • Method Detail

      • getAllAnchorLinks

        public static java.util.List<java.lang.String> getAllAnchorLinks​(java.lang.String page)
        Returns the values of the "href" attribute of all "a" tags on the page as a list of strings.
        Parameters:
        page - the page source
        Returns:
        the href attribute values
      • getAllImageLinks

        public static java.util.List<java.lang.String> getAllImageLinks​(java.lang.String page)
        Returns the values of the "src" attribute of all "img" tags on the page as a list of strings.
        Parameters:
        page - the page source
        Returns:
        the src attribute values
      • getAllLinkLinks

        public static java.util.List<java.lang.String> getAllLinkLinks​(java.lang.String page)
        Returns the values of the "href" attribute of all "link" tags on the page as a list of strings.
        Parameters:
        page - the page source
        Returns:
        the href attribute values
      • getAllScriptLinks

        public static java.util.List<java.lang.String> getAllScriptLinks​(java.lang.String page)
        Returns the values of the "src" attribute of all "script" tags on the page as a list of strings.
        Parameters:
        page - the page source
        Returns:
        the src attribute values