import java.io.*; import java.io.File; import java.util.Date; import java.net.URL; import org.webharvest.definition.*; import org.webharvest.runtime.*; import org.webharvest.runtime.variables.*; class fScrape { public static void main(String[] args) { try { ScraperConfiguration config = new ScraperConfiguration("/home/clryd/harvest/dn.xml"); Scraper scraper = new Scraper(config, "/home/clryd/harvest/temp/"); scraper.addVariableToContext("url", "http://www.dn.se/nyheter/sverige/svenska-svart-sjuk-i-den-nya-influensan-1.910697"); scraper.setDebug(true); scraper.execute(); // takes variable created during execution Variable article = (Variable)scraper.getContext().getVar("article"); // do something with articles... System.out.println(article.toString()); } catch (FileNotFoundException e) { System.out.println(e.getMessage()); } } }