/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.apache.commons.beanutils.BeanUtils
 *  us.codecraft.webmagic.Page
 *  us.codecraft.webmagic.Site
 *  us.codecraft.webmagic.model.AfterExtractor
 *  us.codecraft.webmagic.model.OOSpider
 *  us.codecraft.webmagic.model.annotation.ExtractBy
 *  us.codecraft.webmagic.model.annotation.ExtractByUrl
 *  us.codecraft.webmagic.model.annotation.HelpUrl
 *  us.codecraft.webmagic.model.annotation.TargetUrl
 *  us.codecraft.webmagic.pipeline.PageModelPipeline
 */
package com.hst.taxService.pageProcessor.domain;

import com.hst.common.bo.FwhZxzcZxwj;
import com.hst.framework.constants.WebConstants;
import com.hst.taxService.pageProcessor.dao.TaxWxfwZxwjDao;
import com.hst.taxService.pageProcessor.pipeline.ZxwjPipeLine;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.beanutils.BeanUtils;
import us.codecraft.webmagic.Page;
import us.codecraft.webmagic.Site;
import us.codecraft.webmagic.model.AfterExtractor;
import us.codecraft.webmagic.model.OOSpider;
import us.codecraft.webmagic.model.annotation.ExtractBy;
import us.codecraft.webmagic.model.annotation.ExtractByUrl;
import us.codecraft.webmagic.model.annotation.HelpUrl;
import us.codecraft.webmagic.model.annotation.TargetUrl;
import us.codecraft.webmagic.pipeline.PageModelPipeline;

@HelpUrl(value={"http://www.chinatax.gov.cn/n810341/n810755/index_\\w+.html"})
@TargetUrl(value={"http://www.chinatax.gov.cn/n810341/n810755/\\w+*/content.html"})
public class ZxwjDomain
implements Serializable,
AfterExtractor {
    private static final long serialVersionUID = 1L;
    @ExtractBy(value="//li[@class='sv_texth1_red']/text()", notNull=true)
    private String bt;
    @ExtractBy(value="//li[@class='sv_black14_30']/text()")
    private String wjh;
    @ExtractBy(value="meta[@name='pubdate']/@content")
    private String fbrq;
    @ExtractBy(value="//li[@class='sv_blue24']/text()")
    private String fbdw;
    @ExtractBy(value="//li[@class='sv_texth3' ]/html()")
    private String nr;
    @ExtractByUrl
    private String url;

    public String getBt() {
        return this.bt;
    }

    public void setBt(String bt) {
        this.bt = bt;
    }

    public String getWjh() {
        return this.wjh;
    }

    public void setWjh(String wjh) {
        this.wjh = wjh;
    }

    public String getFbrq() {
        return this.fbrq;
    }

    public void setFbrq(String fbrq) {
        this.fbrq = fbrq;
    }

    public String getFbdw() {
        return this.fbdw;
    }

    public void setFbdw(String fbdw) {
        this.fbdw = fbdw;
    }

    public String getNr() {
        return this.nr;
    }

    public void setNr(String nr) {
        this.nr = nr;
    }

    public String getUrl() {
        return this.url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public static void main(String[] args) {
        OOSpider.create((Site)Site.me().setSleepTime(20), (PageModelPipeline)new ZxwjPipeLine(), (Class[])new Class[]{ZxwjDomain.class}).addUrl(new String[]{"http://www.chinatax.gov.cn/n810341/n810755/index.html"}).run();
    }

    public void afterProcess(Page page) {
        TaxWxfwZxwjDao dao = (TaxWxfwZxwjDao)WebConstants.WEB_APP_CONTEXT.getBean("taxWxfwZxwjDaoImp");
        FwhZxzcZxwj bo = new FwhZxzcZxwj();
        try {
            BeanUtils.copyProperties((Object)bo, (Object)this);
            dao.saveWxYhxx(bo);
        }
        catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        catch (InvocationTargetException e) {
            e.printStackTrace();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}
