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

us.codecraft.webmagic.model.samples.IteyeBlog Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package us.codecraft.webmagic.model.samples;

import us.codecraft.webmagic.Site;
import us.codecraft.webmagic.model.annotation.ExtractBy;
import us.codecraft.webmagic.model.OOSpider;
import us.codecraft.webmagic.model.annotation.TargetUrl;

/**
 * @author [email protected] 
* Date: 13-8-2
* Time: 上午7:52
*/ @TargetUrl("http://*.iteye.com/blog/*") public class IteyeBlog implements Blog{ @ExtractBy("//title") private String title; @ExtractBy(value = "div#blog_content",type = ExtractBy.Type.Css) private String content; @Override public String toString() { return "IteyeBlog{" + "title='" + title + '\'' + ", content='" + content + '\'' + '}'; } public static void main(String[] args) { OOSpider.create(Site.me(), IteyeBlog.class).addUrl("http://flashsword20.iteye.com/blog").run(); } public String getTitle() { return title; } public String getContent() { return content; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy