name
HtmlElementFinder
import prohtml.*;

HtmlElementFinder htmlElementFinder;

void setup(){
  //enter your url here
  htmlElementFinder = new HtmlElementFinder("http://www.yoururl.com","a"); 

  java.util.List links = htmlElementFinder.getElements();

  for (int i = 0;i<links.size();i++){
    println(((StandAloneElement)links.get(i)).getAttribute("href"));
  }
}
description
Use this class to directly find all elements of a given type. HtmlElementFinder parses a HtmlDocument and puts all elements matching the given type into a list. You can search for existing html elements. To search for textelements only type in "text ". The result of the HtmlElementFinder contains only standalone elements and text elements. This is because the tree structure of the html document gets lost parsing it into a HtmlELementFinder. There is no element having children.
constructors
HtmlElementFinder(url, kindOfElement);
HtmlElementFinder(page, url, kindOfElement);
HtmlCollection(url);
HtmlCollection(page, url);
parameters
url
String, url to the document you want to scan
kindOfElement
String, name of the element you look for
page,
StringReader holding the document youwant to scan
url
String
fields
Arraylist holding the colors found in the page
Keeps the absolutepart (without file information) of the url of this document.
methods
This methods gives you an ArrayList with the elements you looked for.
Use this Method to get the number of all different colors of a HTML document.
GetPageColor gives you a specified color of an HtmlPage.
Use this method for a simple trace of all elements in the list of the parsed html document.
usage
Web & Application
related