【实例简介】包含几个使用方法示例,如下文:
【实例截图】
【核心代码】
package com.zhy.spider.test;
import java.util.List;
import com.zhy.spider.bean.LinkTypeData;
import com.zhy.spider.core.ExtractService;
import com.zhy.spider.rule.Rule;
public class Test
{
@org.junit.Test
public void getDatasByClass()
{
Rule rule = new Rule(
"http://www1.sxcredit.gov.cn/public/infocomquery.do?method=publicIndexQuery",
new String[] { "query.enterprisename","query.registationnumber" }, new String[] { "兴网","" },
"cont_right", Rule.CLASS, Rule.POST);
List extracts = ExtractService.extract(rule);
printf(extracts);
}
@org.junit.Test
public void getDatasByCssQuery()
{
Rule rule = new Rule("h