All Downloads are FREE. Search and download functionalities are using the official Maven repository.

us.codecraft.webmagic.pipeline.ConsolePipeline Maven / Gradle / Ivy

The newest version!
package us.codecraft.webmagic.pipeline;

import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;

import java.util.Map;

/**
 * Write results in console.
* Usually used in test. * * @author [email protected]
* @since 0.1.0 */ public class ConsolePipeline implements Pipeline { @Override public void process(ResultItems resultItems, Task task) { System.out.println("get page: " + resultItems.getRequest().getUrl()); for (Map.Entry entry : resultItems.getAll().entrySet()) { System.out.println(entry.getKey() + ":\t" + entry.getValue()); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy