package us.codecraft.webmagic.pipeline;

import us.codecraft.webmagic.Page;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.selector.Selectable;

import java.util.Map;

/**
 * @author code4crafter@gmail.com <br>
 * Date: 13-4-21
 * Time: 下午1:45
 */
public class ConsolePipeline implements  Pipeline{

    @Override
    public void process(Page page,Task task) {
        System.out.println("get page: "+page.getUrl());
        for (Map.Entry<String, Selectable> entry : page.getFields().entrySet()) {
            System.out.println(entry.getKey()+":\t"+entry.getValue().toStrings());
        }
    }
}

@@ -602,16 +602,111 @@
       %7D%0A
+        if (page.getExtra()!=null)%7B%0A            System.out.println(page.getExtra());%0A        %7D%0A
     %7D%0A%7D%0A

add extra