Package org.webharvest.runtime

Examples of org.webharvest.runtime.Scraper.execute()


        Scraper scraper = new Scraper(config, "c:/temp/scrapertest/");

        scraper.setDebug(true);

        long startTime = System.currentTimeMillis();
        scraper.execute();
        System.out.println("time elapsed: " + (System.currentTimeMillis() - startTime));
    }

}
View Full Code Here


                        scraper.addVariableToContext(varName, entry.getValue());
                    }
                }
            }

            scraper.execute();
        }
    }

    private static void printHelp() {
        System.out.println("");
View Full Code Here

        try
        {
            ScraperConfiguration config = new ScraperConfiguration(configFile);
            Scraper scraper = new Scraper(config,resFile);
            scraper.setDebug(true);
            scraper.execute();
        }
        catch (FileNotFoundException ex)
        {
          
        }
View Full Code Here

        InputStream in = new ByteArrayInputStream(config.toString().getBytes());
        InputSource inputSource = new InputSource(in);
        ScraperConfiguration scraperConfiguration = new ScraperConfiguration(inputSource);
        Scraper scraper = new Scraper(scraperConfiguration, "");
        // Execute the scraper config
        scraper.execute();
        scraperContext = scraper.getContext();
    }

    private void setConfig(OMElement config) {
        this.config = config;
View Full Code Here

    /*executing the web scraper*/
    public Variable getScrapedResult(String queryVariable) throws DataServiceFault {
        try {
            Scraper scraper = getScraperConfig();
            scraper.execute();
            return (Variable) scraper.getContext().get(queryVariable);
        } catch (Exception e) {
            throw new DataServiceFault(e, "Error in Scraper Execution");
        }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.