// Path: crawler-core/src/main/java/com/github/xbynet/crawler/Const.java
// public class Const {
// 	public enum HttpMethod{
// 		GET,POST,HEAD
// 	}
// 	public enum CssAttr{
// 		innerHtml,text,allText
// 	}
// 	public enum ResponseType{
// 		TEXT,BIN
// 	}
// }


import java.util.ArrayList;
import java.util.List;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import org.jsoup.nodes.TextNode;
import org.jsoup.select.Elements;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.xbynet.crawler.Const;
		} else {
			return element.attr(attrName);
		}
	}

	protected String getText(Element element) {
		StringBuilder accum = new StringBuilder();
		for (Node node : element.childNodes()) {
			if (node instanceof TextNode) {
				TextNode textNode = (TextNode) node;
				accum.append(textNode.text());
			}
		}
		return accum.toString();
	}

	public Element element(String cssSelector) {
		Elements els = getDoc().select(cssSelector);
		if (els == null || els.size() == 0) {
			log.warn("所选元素不存在" + cssSelector);
			return null;
		}
		return els.get(0);
	}

	public Elements elements(String cssSelector) {
		Elements els = getDoc().select(cssSelector);
		return els;
	}
	public String script(String cssSelector) {
// Path: crawler-core/src/main/java/com/github/xbynet/crawler/Const.java
// public class Const {
// 	public enum HttpMethod{
// 		GET,POST,HEAD
// 	}
// 	public enum CssAttr{
// 		innerHtml,text,allText
// 	}
// 	public enum ResponseType{
// 		TEXT,BIN
// 	}
// }


// Path: crawler-core/src/main/java/com/github/xbynet/crawler/parser/JsoupParser.java
import java.util.ArrayList;
import java.util.List;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import org.jsoup.nodes.TextNode;
import org.jsoup.select.Elements;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.xbynet.crawler.Const;

		} else {
			return element.attr(attrName);
		}
	}

	protected String getText(Element element) {
		StringBuilder accum = new StringBuilder();
		for (Node node : element.childNodes()) {
			if (node instanceof TextNode) {
				TextNode textNode = (TextNode) node;
				accum.append(textNode.text());
			}
		}
		return accum.toString();
	}

	public Element element(String cssSelector) {
		Elements els = getDoc().select(cssSelector);
		if (els == null || els.size() == 0) {
			log.warn("所选元素不存在" + cssSelector);
			return null;
		}
		return els.get(0);
	}

	public Elements elements(String cssSelector) {
		Elements els = getDoc().select(cssSelector);
		return els;
	}
	public String script(String cssSelector) {
		return single(cssSelector,Const.CssAttr.innerHtml.name());