From 583a0eba8c04d29ab30bac74138a586aa4edc475 Mon Sep 17 00:00:00 2001 From: "yihua.huang" Date: Sun, 3 Nov 2013 20:24:26 +0800 Subject: [PATCH] #29 refactor some method name --- .../src/main/java/us/codecraft/webmagic/Spider.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java b/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java index 54f51d9b..32bd3e1f 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java @@ -343,12 +343,12 @@ public class Spider implements Runnable, Task { } // for cycle retry if (page.getHtml() == null) { - addRequest(page); + extractAndAddRequests(page); sleep(site.getSleepTime()); return; } pageProcessor.process(page); - addRequest(page); + extractAndAddRequests(page); if (!page.getResultItems().isSkip()) { for (Pipeline pipeline : pipelines) { pipeline.process(page.getResultItems(), this); @@ -365,7 +365,7 @@ public class Spider implements Runnable, Task { } } - protected void addRequest(Page page) { + protected void extractAndAddRequests(Page page) { if (CollectionUtils.isNotEmpty(page.getTargetRequests())) { for (Request request : page.getTargetRequests()) { addRequest(request);