remove duplicated class

master
yihua.huang 2013-08-06 22:38:12 +08:00
parent c7005a0227
commit f413450403
3 changed files with 1 additions and 64 deletions

View File

@ -1,40 +0,0 @@
package us.codecraft.webmagic.model;
import us.codecraft.webmagic.Page;
import us.codecraft.webmagic.Site;
import java.util.List;
/**
* @author code4crafter@gmail.com <br>
* @date: 13-8-1 <br>
* Time: 10:18 <br>
*/
@TargetUrl("http://my.oschina.net/flashsword/blog/*")
public class OschinaBlog implements AfterExtractor {
@ExtractBy("//title")
private String title;
@ExtractBy(value = "div.BlogContent", type = ExtractBy.Type.Css)
private String content;
@ExtractBy(value = "//div[@class='BlogTags']/a/text()", multi = true)
private List<String> tags;
@ExtractBy(value = "//div[@class='BlogTags']/a/text()", multi = true)
private List<String> comments;
@Override
public void afterProcess(Page page) {
System.out.println("title:\t"+title);
System.out.println("content:\t"+content);
System.out.println("tags:\t" + tags);
page.setSkip(true);
}
public static void main(String[] args) {
OOSpider.create(Site.me().addStartUrl("http://my.oschina.net/flashsword/blog/145796"), OschinaBlog.class)
.run();
}
}

View File

@ -1,24 +0,0 @@
package us.codecraft.webmagic.model;
import org.junit.Ignore;
import org.junit.Test;
import us.codecraft.webmagic.Site;
/**
* @author code4crafter@gmail.com <br>
* @date: 13-8-1 <br>
* Time: 8:42 <br>
*/
public class TestFetcher {
@Ignore("takes long")
@Test
public void test() {
OOSpider.create(Site.me().addStartUrl("http://my.oschina.net/flashsword/blog/145796"), OschinaBlog.class)
.run();
}
}

View File

@ -1,6 +1,7 @@
package us.codecraft.webmagic.scheduler;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import us.codecraft.webmagic.Request;
import us.codecraft.webmagic.Site;