简易的jsoup框架封装

近来工作不繁忙,五点钟就准时下班了,晚上回家总想折腾点什么,在一个月黑风高的晚上,突发奇想,感觉写一个安卓上面可以用用的二次封装的抓数据框架,经过对比,我选择了jsoup,基于jsoup框架进行简单的二次封装(别问我为什么选择jsoup,问就是只知道这个框架)。说干就干,我拿起了我500块钱的机械键盘,花了两个晚上,完成了这个框架。(U1S1,我是为了抓小姐姐图片才写的这个框架)

1.引入jsoup库

dependencies {
    api "org.jsoup:jsoup:1.13.1"
}

2.定义好注解的内容
注解有两个,一个是作用于数据的实体类,另一个是作用于数据字段。
A.作用于数据实体类(HtmlElementField)

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface HtmlElementField {
    /**
     * element获取的类型
     *
     * @return
     */
    int[] types();

    String[] typenames();

    /**
     * 是否是属性的值
     *
     * @return
     */
    boolean isAttr() default false;

    /**
     * 属性的名称
     *
     * @return
     */
    String attrName() default "";

    /**
     * 是否是数组
     *
     * @return
     */
    boolean isArray() default false;

    /**
     * 是否在body寻找
     *
     * @return
     */
    boolean isBody() default true;

    /**
     * 是否是BaseElementData对象,
     * true表示的是BaseElementData对象或者List<BaseElementData>,
     * false表示的是String或者List<String>
     *
     * @return
     */
    boolean isMultiElementData() default false;

    Class<?> filedModelClazz() default Object.class;
}

注解的说明:
types 数组,获取element的类型,GET_ELEMENT_BY_ID 根据id获取element,GET_ELEMENTS_BY_CLASS 根据class名获取所有的element,GET_ELEMENTS_BY_TAG 根据tag名获取所有的element
typenames 数组,id名/class名/tag名
isAttr 值是否是从属性里面获取,false表示拿text
attrName 属性名,默认为""
isArray 返回的结果是不是字符串数组,true返回的是List<String>,false返回的是String
isBody 是否在body搜索,true表示是在body搜索,false表示在head搜索
isMultiElementData 返回的数据是否是对象(对象需要全部都是String类型),true表示的是对象,false表示的是String,是否是数组需要看isArray的值
filedModelClazz 对象的class,用于获取类名

B.作用于数据字段(HtmlElementModelKeyname)

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface HtmlElementModelKeyname {
    /**
     * 数据的name
     *
     * @return
     */
    String keyname();

    /**
     * 获取指定标签的attrs,""表示获取text,其他值表示获取属性
     *
     * @return
     */
    String attrname();
}

注解的说明:
attrname 要获取的属性数组,获取指定标签的attrs,""表示获取text,其他值表示获取属性
keyname 组装数据的name

3.创建字段数据的类(MultiElementData)
主要用于生成json字符串。

public class MultiElementData {
    public String[] keys;
    public String[] values;

    public MultiElementData(String[] keys, String[] values) {
        this.keys = keys;
        this.values = values;
    }

    @Override
    public String toString() {
        StringBuffer stringBuffer = new StringBuffer("{");
        try {
            boolean isNeedDeletePoint = false;
            for (int i = 0; i < keys.length; i++) {
                stringBuffer.append("\"");
                stringBuffer.append(keys[i]);
                stringBuffer.append("\"");
                stringBuffer.append(":");
                stringBuffer.append("\"");
                stringBuffer.append(values[i]);
                stringBuffer.append("\"");
                stringBuffer.append(",");
                isNeedDeletePoint = true;
            }
            if (isNeedDeletePoint) {
                stringBuffer.deleteCharAt(stringBuffer.length() - 1);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        stringBuffer.append("}");
        return stringBuffer.toString();
    }
}

4.创建保存注解信息的实体类
A.HtmlElementFieldModel

public class HtmlElementFieldModel {
    public Field field;
    public HtmlElementField annotation;
}

B.HtmlElementModelKeynameModel

public class HtmlElementModelKeynameModel {
    public Field field;
    public HtmlElementModelKeyname annotation;
}

5.定义获取element的方式(JsoupConstans)

public class JsoupConstans {
    //根据id获取element
    public static final int GET_ELEMENT_BY_ID = 0;
    //根据class获取element
    public static final int GET_ELEMENTS_BY_CLASS = 1;
    //根据tag获取element
    public static final int GET_ELEMENTS_BY_TAG = 2;
    //根据select语句获取element
    public static final int GET_ELEMENTS_BY_ATTRVALUE = 3;
}

6.编写一个jsoup的帮助类(JsoupUtil)
用于操作jsoup的api

public class JsoupUtil {
    private Document document;
    private String url = "";
    //0表示在线html,1代表本地的html文件
    private int type = 0;
    private Element body;
    private Element head;
    private String title;

    public JsoupUtil(String url) throws Exception {
        this(url, 0);
    }

    public JsoupUtil(String url, int type) throws Exception {
        this.url = url;
        this.type = type;
        if (type == 0) {
            init(url);
        } else {
            initLocal(url);
        }
    }

    private void initLocal(String localpath) throws IOException {
        File file = new File(localpath);
        document = Jsoup.parse(file, "UTF-8");
        initHtmlElement();
    }

    private void init(String url) throws Exception {
        document = Jsoup.connect(url).get();
        initHtmlElement();
    }

    /**
     * 获取body,head,title
     */
    private void initHtmlElement() {
        head = document.head();
        body = document.body();
        title = document.title();
    }

    /**
     * 根据id获取节点
     *
     * @param id
     * @param isBody
     * @return
     */
    public Element getElementTypeById(String id, boolean isBody) {
        if (isBody) {
            return getBodyElementById(id);
        } else {
            return getHeadElementById(id);
        }
    }

    /**
     * 根据id获取节点
     *
     * @param id
     * @param isBody
     * @return
     */
    public Elements getElementsTypeById(String id, boolean isBody) {
        if (isBody) {
            return getBodyElementsById(id);
        } else {
            return getHeadElementsById(id);
        }
    }

    /**
     * 根据class获取节点
     *
     * @param className
     * @param isBody
     * @return
     */
    public Elements getElementsTypeByClass(String className, boolean isBody) {
        if (isBody) {
            return getBodyElementsByClass(className);
        } else {
            return getHeadElementsByClass(className);
        }
    }

    /**
     * 根据tag获取节点
     *
     * @param tagName
     * @param isBody
     * @return
     */
    public Elements getElementsTypeByTag(String tagName, boolean isBody) {
        if (isBody) {
            return getBodyElementsByTag(tagName);
        } else {
            return getHeadElementsByTag(tagName);
        }
    }

    /**
     * 根据select语句来获取elements
     *
     * @param selectStr
     * @param isBody
     * @return
     */
    public Elements getElementsBySelectStr(String selectStr, boolean isBody) {
        if (isBody) {
            return getBodyElementsBySelectStr(selectStr);
        } else {
            return getHeadElementsBySelectStr(selectStr);
        }
    }

    /**
     * 获取全部body节点
     *
     * @return
     */
    public Elements getAllElementsType(boolean isBody) {
        if (isBody) {
            return getBodyAllElements();
        } else {
            return getHeadAllElements();
        }
    }

    /**
     * 根据id获取body节点
     *
     * @param id
     * @return
     */
    private Element getBodyElementById(String id) {
        if (body == null) {
            return null;
        }
        return body.getElementById(id);
    }

    /**
     * 根据id获取body节点
     *
     * @param id
     * @return
     */
    private Elements getBodyElementsById(String id) {
        if (body == null) {
            return null;
        }
        return new Elements(body.getElementById(id));
    }

    /**
     * 根据class获取body节点
     *
     * @param className
     * @return
     */
    private Elements getBodyElementsByClass(String className) {
        if (body == null) {
            return null;
        }
        return body.getElementsByClass(className);
    }

    /**
     * 根据tag获取body节点
     *
     * @param tagName
     * @return
     */
    private Elements getBodyElementsByTag(String tagName) {
        if (body == null) {
            return null;
        }
        return body.getElementsByTag(tagName);
    }

    /**
     * 根据select语句获取head的elements
     *
     * @param selectStr
     * @return
     */
    private Elements getBodyElementsBySelectStr(String selectStr) {
        if (body == null) {
            return null;
        }
        return body.select(selectStr);
    }

    /**
     * 获取全部body节点
     *
     * @return
     */
    private Elements getBodyAllElements() {
        if (body == null) {
            return null;
        }
        return body.getAllElements();
    }


    /**
     * 根据id获取head节点
     *
     * @param id
     * @return
     */
    private Element getHeadElementById(String id) {
        if (head == null) {
            return null;
        }
        return head.getElementById(id);
    }

    /**
     * 根据id获取head节点
     *
     * @param id
     * @return
     */
    private Elements getHeadElementsById(String id) {
        if (head == null) {
            return null;
        }
        return new Elements(head.getElementById(id));
    }

    /**
     * 根据class获取head节点
     *
     * @param className
     * @return
     */
    private Elements getHeadElementsByClass(String className) {
        if (head == null) {
            return null;
        }
        return head.getElementsByClass(className);
    }

    /**
     * 根据tag获取head节点
     *
     * @param tagName
     * @return
     */
    private Elements getHeadElementsByTag(String tagName) {
        if (head == null) {
            return null;
        }
        return head.getElementsByTag(tagName);
    }

    /**
     * 根据select语句获取head的elements
     *
     * @param selectStr
     * @return
     */
    private Elements getHeadElementsBySelectStr(String selectStr) {
        if (head == null) {
            return null;
        }
        return head.select(selectStr);
    }

    /**
     * 获取全部head节点
     *
     * @return
     */
    private Elements getHeadAllElements() {
        if (head == null) {
            return null;
        }
        return head.getAllElements();
    }

    /**
     * 释放资源
     */
    public void release() {
        document = null;
        body = null;
        head = null;
        System.gc();
    }

}

7.处理注解与jsoup帮助类(JsoupManager)

public class JsoupManager<T> {
    private Class<T> clazz;
    private static final String TAG = "JsoupManager";
    private Field[] allFields;
    private List<HtmlElementFieldModel> fieldModels;
    HashMap<String, String[]> multiElementAttrsHashmap = new HashMap<>();
    HashMap<String, String[]> multiElementKeysHashmap = new HashMap<>();

    public JsoupManager(Class<T> clazz, Class<?>... otherClazz) {
        this.clazz = clazz;
        // 得到所有定义字段
        allFields = clazz.getDeclaredFields();
        fieldModels = getFieldsAndSort();
        if (otherClazz != null) {
            initMultiAttrAndNames(otherClazz);
        }
    }

    public JsoupManager(Class<T> clazz) {
        this(clazz, null);
    }

    public T getDataByUrl(String url) {
        T result = null;
        SystemLogUtil.printSysLog("getDataByUrl", url);
        JsoupUtil jsoupUtil = null;
        try {
            jsoupUtil = new JsoupUtil(url);
            StringBuffer buffer = new StringBuffer("{");
            boolean isNeedDeletePoint = false;
            for (int i = 0; i < fieldModels.size(); i++) {
                HtmlElementFieldModel htmlElementFieldModel = fieldModels.get(i);
                //拼接json的字段名
                String fieldname = htmlElementFieldModel.field.getName();
                buffer.append("\"");
                buffer.append(fieldname);
                buffer.append("\"");
                buffer.append(":");
                int[] types = htmlElementFieldModel.annotation.types();
                String[] names = htmlElementFieldModel.annotation.typenames();
                //是否返回的是attr的值
                boolean isAttr = htmlElementFieldModel.annotation.isAttr();
                //attr名称
                String attrName = htmlElementFieldModel.annotation.attrName();
                //是否是返回字符串数组
                boolean isArray = htmlElementFieldModel.annotation.isArray();
                boolean isBody = htmlElementFieldModel.annotation.isBody();
                boolean isMultiData = htmlElementFieldModel.annotation.isMultiElementData();
                Class<?> filedModelClazz = htmlElementFieldModel.annotation.filedModelClazz();

                ArrayList<Element> elements = getElements(jsoupUtil, types, names, isBody);
                String className = filedModelClazz.getName();
                String[] multiElementAttrs = multiElementAttrsHashmap.get(className);
                String[] multiElementKeys = multiElementKeysHashmap.get(className);

                //拼接json的值的字符串
                if (!isArray) {
                    if (!isMultiData) {
                        appendValues(buffer, isAttr, attrName, elements, 0);
                    } else {
                        appendMultiData(buffer, multiElementAttrs, multiElementKeys, elements, 0);
                    }
                    isNeedDeletePoint = true;
                } else {
                    buffer.append("[");
                    boolean isNeedDeletePointInside = false;
                    for (int j = 0; j < elements.size(); j++) {
                        if (!isMultiData) {
                            appendValues(buffer, isAttr, attrName, elements, j);
                        } else {
                            appendMultiData(buffer, multiElementAttrs, multiElementKeys, elements, j);
                        }
                        isNeedDeletePointInside = true;
                    }
                    if (isNeedDeletePointInside) {
                        buffer.deleteCharAt(buffer.length() - 1);
                    }
                    buffer.append("]");
                    buffer.append(",");
                    if (i == fieldModels.size() - 1) {
                        isNeedDeletePoint = true;
                    } else {
                        isNeedDeletePoint = false;
                    }
                }
            }
            if (isNeedDeletePoint) {
                buffer.deleteCharAt(buffer.length() - 1);
            }
            buffer.append("}");
            result = GsonUtils.getInstance().getEntetyByString(buffer.toString(), clazz);
        } catch (Exception e) {
            e.printStackTrace();
            SystemLogUtil.printSysLog("JsoupManager", e.getMessage().toString());
        } finally {
            //释放
            if (jsoupUtil != null) {
                jsoupUtil.release();
            }
        }
        return result;
    }

    /**
     * 拼接对象
     *
     * @param buffer
     * @param multiElementAttrs
     * @param multiElementKeys
     * @param elements
     * @param j
     */
    private void appendMultiData(StringBuffer buffer, String[] multiElementAttrs, String[] multiElementKeys, ArrayList<Element> elements, int j) throws Exception {
        String[] multiElementValues = new String[multiElementAttrs.length];
        for (int i = 0; i < multiElementAttrs.length; i++) {
            String multiElementAttr = multiElementAttrs[i];
            if (multiElementAttr == "") {
                multiElementValues[i] = elements.get(j).text();
            } else {
                multiElementValues[i] = elements.get(j).attr(multiElementAttr);
            }
        }
        MultiElementData multiElementData = new MultiElementData(multiElementKeys, multiElementValues);
        buffer.append(multiElementData.toString());
        buffer.append(",");
    }

    /**
     * 拼接值的字符串
     *
     * @param buffer
     * @param isAttr
     * @param attrName
     * @param elements
     * @param j
     */
    private void appendValues(StringBuffer buffer, boolean isAttr, String attrName, ArrayList<Element> elements, int j) {
        String value = "";
        try {
            value = isAttr ? elements.get(j).attr(attrName) : elements.get(j).text();
        } catch (Exception e) {
            e.printStackTrace();
        }
        buffer.append("\"");
        buffer.append(value);
        buffer.append("\"");
        buffer.append(",");
    }

    /**
     * 获取所有的目标element
     *
     * @param jsoupUtil
     * @param types
     * @param names
     * @param isBody
     * @return
     */
    private ArrayList<Element> getElements(JsoupUtil jsoupUtil, int[] types, String[] names, boolean isBody) {
        try {
            if (types.length > 1) {
                return getElementsMulti(jsoupUtil, types, names, isBody);
            } else {
                return getElementsSingle(jsoupUtil, types[0], names[0], isBody);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return new ArrayList<>();
    }

    /**
     * TODO 有多层级选择器的情况
     *
     * @param jsoupUtil
     * @param types
     * @param names
     * @param isBody
     * @return
     */
    private ArrayList<Element> getElementsMulti(JsoupUtil jsoupUtil, int[] types, String[] names, boolean isBody) throws Exception {
        ArrayList<Element> result = new ArrayList<>();
        ArrayList<Element> temp = new ArrayList<>();
        boolean isFirst = true;
        for (int i = 0; i < types.length; i++) {
            dealTempData(temp, jsoupUtil, types[i], names[i], isFirst, isBody);
            isFirst = false;
        }
        result.addAll(temp);
        return result;
    }

    private void dealTempData(ArrayList<Element> temp, JsoupUtil jsoupUtil, int type, String name, boolean isFirst, boolean isBody) throws Exception {
        if (isFirst) {
            //获取第一级数据
            if (type == GET_ELEMENT_BY_ID) {
                temp.addAll(jsoupUtil.getElementsTypeById(name, isBody));
            } else if (type == GET_ELEMENTS_BY_CLASS) {
                temp.addAll(jsoupUtil.getElementsTypeByClass(name, isBody));
            } else if (type == GET_ELEMENTS_BY_TAG) {
                temp.addAll(jsoupUtil.getElementsTypeByTag(name, isBody));
            } else if (type == GET_ELEMENTS_BY_ATTRVALUE) {
                temp.addAll(jsoupUtil.getElementsBySelectStr(name, isBody));
            }
        } else {
            if (temp == null) {
                temp = new ArrayList<>();
            }
            ArrayList<Element> tempNew = new ArrayList<>(temp);
            temp.clear();
            //非第一级数据
            if (tempNew != null && tempNew.size() > 0) {
                for (int i = 0; i < tempNew.size(); i++) {
                    if (type == GET_ELEMENT_BY_ID) {
                        temp.add(tempNew.get(i).getElementById(name));
                    } else if (type == GET_ELEMENTS_BY_CLASS) {
                        temp.addAll(tempNew.get(i).getElementsByClass(name));
                    } else if (type == GET_ELEMENTS_BY_TAG) {
                        temp.addAll(tempNew.get(i).getElementsByTag(name));
                    } else if (type == GET_ELEMENTS_BY_ATTRVALUE) {
                        temp.addAll(tempNew.get(i).select(name));
                    }
                }
            }
        }
    }

    /**
     * 只有一层筛选条件的情况下
     *
     * @param jsoupUtil
     * @param type
     * @param name
     * @param isBody
     * @return
     */
    private ArrayList<Element> getElementsSingle(JsoupUtil jsoupUtil, int type, String name, boolean isBody) throws Exception {
        ArrayList<Element> result = new ArrayList<>();
        if (type == GET_ELEMENT_BY_ID) {
            result.addAll(jsoupUtil.getElementsTypeById(name, isBody));
        } else if (type == GET_ELEMENTS_BY_CLASS) {
            result.addAll(jsoupUtil.getElementsTypeByClass(name, isBody));
        } else if (type == GET_ELEMENTS_BY_TAG) {
            result.addAll(jsoupUtil.getElementsTypeByTag(name, isBody));
        } else if (type == GET_ELEMENTS_BY_ATTRVALUE) {
            result.addAll(jsoupUtil.getElementsBySelectStr(name, isBody));
        }
        return result;
    }

    /**
     * 获取全部的字段并排序
     *
     * @return
     */
    private List<HtmlElementFieldModel> getFieldsAndSort() {
        List<HtmlElementFieldModel> outputFieldModels = new ArrayList<HtmlElementFieldModel>();
        for (Field field : allFields) {
            if (field.isAnnotationPresent(HtmlElementField.class)) {
                HtmlElementFieldModel outputFieldModel = new HtmlElementFieldModel();
                outputFieldModel.field = field;
                outputFieldModel.annotation = field.getAnnotation(HtmlElementField.class);
                outputFieldModels.add(outputFieldModel);
            }
        }
        return outputFieldModels;
    }

    /**
     * 获取全部的字段并排序
     *
     * @param allMdFields
     * @return
     */
    private List<HtmlElementModelKeynameModel> getMdFieldsAndSort(Field[] allMdFields) {
        List<HtmlElementModelKeynameModel> outputFieldModels = new ArrayList<HtmlElementModelKeynameModel>();
        for (Field field : allMdFields) {
            if (field.isAnnotationPresent(HtmlElementModelKeyname.class)) {
                HtmlElementModelKeynameModel outputFieldModel = new HtmlElementModelKeynameModel();
                outputFieldModel.field = field;
                outputFieldModel.annotation = field.getAnnotation(HtmlElementModelKeyname.class);
                outputFieldModels.add(outputFieldModel);
            }
        }
        return outputFieldModels;
    }

    /**
     * 初始化
     *
     * @param otherClazz
     */
    private void initMultiAttrAndNames(Class<?>[] otherClazz) {
        for (int index = 0; index < otherClazz.length; index++) {
            try {
                Class<?> tempClazz = otherClazz[index];
                String className = tempClazz.getName();
                List<HtmlElementModelKeynameModel> fieldMdModels = getMdFieldsAndSort(tempClazz.getDeclaredFields());
                String[] attrs = new String[fieldMdModels.size()];
                String[] keys = new String[fieldMdModels.size()];
                for (int i = 0; i < fieldMdModels.size(); i++) {
                    attrs[i] = fieldMdModels.get(i).annotation.attrname();
                    keys[i] = fieldMdModels.get(i).annotation.keyname();
                }
                multiElementAttrsHashmap.put(className, attrs);
                multiElementKeysHashmap.put(className, keys);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}

-------------------------------------------------------------------------------------------这里是华丽的分割线-------------------------------------------------------------------------------------------

下面就到了使用的环节了

1.编写数据实体类(例子:MenuNetModel)

public class MenuNetModel {
    /**
     * 表示查找id为htitle的text内容(第一个)
     */
    @HtmlElementField(types = GET_ELEMENT_BY_ID, typenames = "htitle")
    public String title;
    /**
     * 表示查找id为menu-second-navi的属性为class内容(第一个)
     */
    @HtmlElementField(types = GET_ELEMENT_BY_ID, typenames = "menu-second-navi", isAttr = true, attrName = "class")
    public String titleTemp;
    /**
     * 表示查找class为caption的属性值为 href=/g/35261/的text
     */
    @HtmlElementField(types = {GET_ELEMENTS_BY_CLASS, GET_ELEMENTS_BY_ATTRVALUE}, typenames = {"caption", "[href=/g/35261/]"})
    public String attrText;
    /**
     * 表示查找class为caption的属性值为 href=/g/35261/的text数组
     */
    @HtmlElementField(types = {GET_ELEMENTS_BY_CLASS, GET_ELEMENTS_BY_ATTRVALUE}, typenames = {"caption", "[href=/g/35261/]"}, isArray = true)
    public List<String> attrTexts;
    /**
     * 表示查找属性值为 href=/g/35261/的text
     */
    @HtmlElementField(types = GET_ELEMENTS_BY_ATTRVALUE, typenames = "[href=/g/35261/]")
    public String attrText1;
    /**
     * 表示查找属性值为 href=/g/35261/的text数组
     */
    @HtmlElementField(types = GET_ELEMENTS_BY_ATTRVALUE, typenames = "[href=/g/35261/]", isArray = true)
    public List<String> attrTexts1;
    /**
     * 表示查找id为map_rank下面的a标签的text数组
     */
    @HtmlElementField(types = {GET_ELEMENT_BY_ID, GET_ELEMENTS_BY_TAG}, typenames = {"map_rank", "a"}, isArray = true)
    public List<String> locationName;
    /**
     * 表示查找id为map_rank下面的a标签的属性href的值数组
     */
    @HtmlElementField(types = {GET_ELEMENT_BY_ID, GET_ELEMENTS_BY_TAG}, typenames = {"map_rank", "a"}, isArray = true, isAttr = true, attrName = "href")
    public List<String> locationPath;
    /**
     * 表示查找class为tag_div下面的a标签的数据数组
     */
    @HtmlElementField(types = {GET_ELEMENTS_BY_CLASS, GET_ELEMENTS_BY_TAG}, typenames = {"tag_div", "a"}, isArray = true,
            isMultiElementData = true, filedModelClazz = ElementData.class)
    public List<ElementData> data;
    /**
     * 表示查找class为tag_div下面的a标签的数据数组
     */
    @HtmlElementField(types = {GET_ELEMENTS_BY_CLASS, GET_ELEMENTS_BY_TAG}, typenames = {"tag_div", "a"}, isArray = true,
            isMultiElementData = true, filedModelClazz = ElementDataTemp.class)
    public List<ElementDataTemp> dataTemp;

    public static class ElementData {
        /**
         * 表示是获取text
         */
        @HtmlElementModelKeyname(attrname = "", keyname = "name")
        public String name;
        /**
         * 表示是获取href的属性值
         */
        @HtmlElementModelKeyname(attrname = "href", keyname = "path")
        public String path;

        @Override
        public String toString() {
            return "ElementData{" +
                    "name='" + name + '\'' +
                    ", path='" + path + '\'' +
                    '}';
        }
    }

    public static class ElementDataTemp {
        @HtmlElementModelKeyname(attrname = "", keyname = "name1")
        public String name1;
        @HtmlElementModelKeyname(attrname = "href", keyname = "path1")
        public String path1;

        @Override
        public String toString() {
            return "ElementDataTemp{" +
                    "name1='" + name1 + '\'' +
                    ", path1='" + path1 + '\'' +
                    '}';
        }
    }

    @Override
    public String toString() {
        return "MenuNetModel{" +
                "title='" + title + '\'' +
                ", titleTemp='" + titleTemp + '\'' +
                ", attrText='" + attrText + '\'' +
                ", attrTexts=" + attrTexts +
                ", attrText1='" + attrText1 + '\'' +
                ", attrTexts1=" + attrTexts1 +
                ", locationName=" + locationName +
                ", locationPath=" + locationPath +
                ", data=" + data +
                ", dataTemp=" + dataTemp +
                '}';
    }
}

2.调用JsoupManager
A.如果有数据的isMultiElementData为true

JsoupManager<MenuNetModel> jsoupManager = new JsoupManager<>(MenuNetModel.class, MenuNetModel.ElementData.class, MenuNetModel.ElementDataTemp.class);
MenuNetModel dataByUrl = jsoupManager.getDataByUrl("fullUrl");

B.如果不符合A的情况

JsoupManager<MenuNetModel> manager = new JsoupManager<>(MenuNetModel .class);
MenuNetModel model = manager.getDataByUrl("fullUrl");

3.测试的html

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>美女图片_宅男女神</title>
    <meta name="keywords" content="高清美女图片 美女写真 美女生活照">
    <meta name="description" content="分享海量国内美女高清套图(推女郎、美媛馆等),日韩高清美女图片写真,以及女神博客的生活照和素颜照,并提供强大的检索功能。">
    <link href="https://res.onvshen.com/style/site.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="topwelcome">
    <div id="topcontainer"><span class="span_03">欢迎访问 <a href="#" title="宅男女神">宅男女神</a> | 最全面女神资料 | 最高清美女图片 </span><span
            class="span_09"></span><span class="span_08"><a href="/message/">访客留言</a></span><span
            class="span_06"><a href="javascript:void(0)" onclick="addfavorite()">收藏本站</a></span>
    </div>
</div>
<div id="wrapper">
    <div id="top"><!------------上部导航菜单-------------->
        <div id="topnav">
            <div class="left_top ">
                <div class="home"><a href="/" title="首  页" class="home"></a></div>
                <div class="menu-main-navi-container">
                    <ul id="menu-main-navi" class="menu">
                        <li class="menu-item"><a href="/article/">最新情报</a></li>
                        <li class="menu-item"><a href="/find/">宅男女神专区</a></li>
                        <li class="menu-item"><a href="/gallery/">美女图片</a></li>
                        <li class="menu-item"><a href="/rank/">宅男女神排行榜</a></li>
                        <li class="menu-item"><a href="/arena/">女神大PK</a></li>
                        <li class="menu-item"><a href="/tag/">倾城·美人榜</a></li>
                        <li class="menu-item"><a href="/meet/">巧遇女神</a></li>
                        <li class="menu-item"><a href="/apply/match.aspx">女神速配</a></li>
                    </ul>
                </div>
            </div>
        </div><!------------上部导航菜单结束--------------></div>
    <div class="search_box"><span class="search_box_span"><input type="image"
                                                                 src="https://res.onvshen.com/style/HotNewspro/images/go.gif"
                                                                 class="go" alt="Search" title="搜索"><input
            id="txtInput" type="text" class="search_text" onkeydown="fnKeydown(event);"
            value="输入名称关键字" onkeyup="fnKeyup(event)" onblur="searchBlur()" onfocus="searchFocus()"></span>
        <button type="button" class="g-button-red g-button" onclick="searchResult()" value="查询">查询
        </button>
        <button type="button" class="g-button-yellow g-button" value="找美女"
                onclick="location='/find/'">找美女
        </button>
        <span class="hot_type_span"><span style="margin: 0 5px; color: #dd4b39; font-weight: bold;">热门查询:</span><span><a
                title="克拉女神" href="/gallery/kela/">克拉女神</a></span><span><a title="语画界"
                                                                           href="/gallery/xiaoyu/">语画界</a></span><span><a
                title="美媛馆" href="/gallery/meiyuanguan/">美媛馆</a></span><span><a title="波萝社"
                                                                                href="/gallery/bololi/">波萝社</a></span><span><a
                title="魅妍社" href="/gallery/mistar/">魅妍社</a></span><span><a title="模范学院"
                                                                           href="/gallery/mfstar/">模范学院</a></span></span><i
                class="search_lb"></i><i class="search_rb"></i>
        <ul id="top_search_list" style="display: none"></ul>
    </div>

    <div id="post_rank">
        <div id="map_rank">
            <div class="browse">
                现在位置: <a title="返回首页" href="/">首页</a> &gt; <a title="美女图片" href="/gallery/">美女图片</a>
            </div>
        </div>
        <div class="entry_box_arena">
            <div class="box_entry" style="overflow: hidden;">
                <div class="gallery_h1_div"><h1 id="htitle" class="gallery_h1">美女图片</h1>
                    <div id="ddesc">分享海量国内美女高清套图(推女郎、美媛馆等),日韩高清美女图片写真,以及女神博客的生活照和素颜照,并提供强大的检索功能。
                    </div>
                </div>
                <div class="tag_div">
                    <ul>
                        <li><a href="/gallery/meiguo/">美国</a><a href="/gallery/eluosi/">俄罗斯</a><a
                                href="/gallery/wukelan/">乌克兰</a><a href="/gallery/yingguo/">英国</a><a
                                href="/gallery/faguo/">法国</a><a href="/gallery/deguo/">德国</a><a
                                href="/gallery/yidali/">意大利</a><a href="/gallery/xibanya/">西班牙</a><a
                                href="/gallery/helan/">荷兰</a><a href="/gallery/jieke/">捷克</a><a
                                href="/gallery/keluodiya/">克罗地亚</a><a href="/gallery/danmai/">丹麦</a><a
                                href="/gallery/tuerqi/">土耳其</a><a href="/gallery/ruidian/">瑞典</a><a
                                href="/gallery/putaoya/">葡萄牙</a><a href="/gallery/xila/">希腊</a><a
                                href="/gallery/yazhou/">亚洲</a><a href="/gallery/yilang/">伊朗</a><a
                                href="/gallery/aierlan/">爱尔兰</a><a href="/gallery/nuowei/">挪威</a><a
                                href="/gallery/rihan/">日韩</a><a href="/gallery/baxi/">巴西</a><a
                                href="/gallery/gelunbiya/">哥伦比亚</a><a href="/gallery/weineiruila/">委内瑞拉</a><a
                                href="/gallery/xinjiapo/">新加坡</a><a
                                href="/gallery/aodaliya/">澳大利亚</a><a
                                href="/gallery/jianada/">加拿大</a><a href="/gallery/moxige/">墨西哥</a><a
                                href="/gallery/yiselie/">以色列</a><a href="/gallery/nanfei/">南非</a><a
                                href="/gallery/bolan/">波兰</a><a href="/gallery/saierweiya/">塞尔维亚</a><a
                                href="/gallery/boduolige/">波多黎各</a><a
                                href="/gallery/aodili/">奥地利</a><a
                                href="/gallery/xinxilan/">新西兰</a><a href="/gallery/bilishi/">比利时</a><a
                                href="/gallery/bohei/">波黑</a><a href="/gallery/agenting/">阿根廷</a><a
                                href="/gallery/zhili/">智利</a><a
                                href="/gallery/baieluosi/">白俄罗斯</a><a href="/gallery/guba/">古巴</a><a
                                href="/gallery/hanfu/">汉服</a><a href="/gallery/neidi/">中国内地</a><a
                                href="/gallery/taiwan/">台湾</a><a href="/gallery/xianggang/">香港</a><a
                                href="/gallery/aomen/">澳门</a><a href="/gallery/riben/">日本</a><a
                                href="/gallery/hanguo/">韩国</a><a href="/gallery/malaixiya/">马来西亚</a><a
                                href="/gallery/yuenan/">越南</a><a href="/gallery/taiguo/">泰国</a><a
                                href="/gallery/feilvbin/">菲律宾</a><a href="/gallery/hunxue/">混血</a><a
                                href="/gallery/yindu/">印度</a><a href="/gallery/oumei/">欧美</a><a
                                href="/gallery/feizhou/">非洲</a></li>
                    </ul>
                </div>
                <div class="tag_div">
                    <ul>
                        <li><a href="/gallery/jiemeihua/">姐妹花</a><a href="/gallery/luoli/">萝莉</a><a
                                href="/gallery/wumei/">妩媚</a><a href="/gallery/qingxin/">清新</a><a
                                href="/gallery/mengxi/">萌系</a><a href="/gallery/zhiyu/">治愈系</a><a
                                href="/gallery/qingchun/">清纯</a><a href="/gallery/qizhi/">气质</a><a
                                href="/gallery/xinggan/">性感</a><a href="/gallery/lengyan/">冷艳</a><a
                                href="/gallery/yexing/">野性</a><a href="/gallery/youhuo/">诱惑</a><a
                                href="/gallery/yangyan/">养眼</a><a href="/gallery/dachidu/">大尺度</a><a
                                href="/gallery/chengshu/">成熟</a><a href="/gallery/keai/">可爱</a><a
                                href="/gallery/yubei/">玉背</a><a href="/gallery/shuangmawei/">双马尾</a><a
                                href="/gallery/yundong/">运动</a><a href="/gallery/zhixing/">知性</a><a
                                href="/gallery/feizhuliu/">非主流</a><a href="/gallery/wenshen/">纹身</a>
                        </li>
                    </ul>
                </div>
                <div class="tag_div">
                    <ul>
                        <li><a href="/gallery/gugan/">骨感</a><a href="/gallery/nvshen/">女神</a><a
                                href="/gallery/jipin/">极品</a><a href="/gallery/meitui/">美腿</a><a
                                href="/gallery/botao/">波涛胸涌</a><a
                                href="/gallery/xiongqi/">人间胸器</a><a
                                href="/gallery/jiaoxiao/">娇小萝莉</a><a href="/gallery/tongyanjuru/">童颜巨乳</a><a
                                href="/gallery/rougan/">肉感</a><a href="/gallery/bainen/">白嫩</a><a
                                href="/gallery/xiaomaise/">小麦色</a><a
                                href="/gallery/xiangjian/">香肩</a><a href="/gallery/yuzu/">玉足</a><a
                                href="/gallery/mitaotun/">蜜桃臀</a><a href="/gallery/youwu/">尤物</a><a
                                href="/gallery/meitun/">美臀</a></li>
                    </ul>
                </div>
                <div class="tag_div">
                    <ul>
                        <li><a href="/gallery/lanqiu/">篮球宝贝</a><a href="/gallery/quanji/">拳击宝贝</a><a
                                href="/gallery/zuqiu/">足球宝贝</a><a href="/gallery/dudou/">肚兜</a><a
                                href="/gallery/qipao/">旗袍</a><a href="/gallery/kongjie/">空姐</a><a
                                href="/gallery/dingziku/">丁字裤</a><a href="/gallery/hefu/">和服</a><a
                                href="/gallery/kaibei/">开背毛衣</a><a href="/gallery/bijini/">比基尼</a><a
                                href="/gallery/neiyi/">内衣</a><a href="/gallery/zhifu/">制服</a><a
                                href="/gallery/cos/">角色扮演</a><a href="/gallery/xiaofu/">校服</a><a
                                href="/gallery/hushi/">护士</a><a href="/gallery/shishen/">湿身</a><a
                                href="/gallery/heisi/">黑丝</a><a href="/gallery/nvpu/">女仆</a><a
                                href="/gallery/yanjing/">眼镜</a><a href="/gallery/gaogenxie/">高跟鞋</a><a
                                href="/gallery/jinghua/">警花</a><a href="/gallery/chuniang/">厨娘</a><a
                                href="/gallery/jiaoshi/">教师</a><a href="/gallery/mishu/">秘书</a><a
                                href="/gallery/nvbing/">女兵</a><a href="/gallery/shuishoufu/">水手服</a><a
                                href="/gallery/siwa/">丝袜</a></li>
                    </ul>
                </div>
                <div class="tag_div">
                    <ul>
                        <li><a href="/gallery/yalayi/">雅拉伊</a><a href="/gallery/sungirl/">阳光宝贝</a><a
                                href="/gallery/xiuren/">秀人网</a><a
                                href="/gallery/meiyuanguan/">美媛馆</a><a
                                href="/gallery/imiss/">爱蜜社</a><a href="/gallery/mistar/">魅妍社</a><a
                                href="/gallery/mfstar/">模范学院</a><a href="/gallery/youmihui/">尤蜜荟</a><a
                                href="/gallery/miitao/">蜜桃社</a><a href="/gallery/youwuguan/">尤物馆</a><a
                                href="/gallery/yunvlang/">御女郎</a><a
                                href="/gallery/feilin/">嗲囡囡</a><a href="/gallery/micat/">瑞丝馆
                            (猫萌榜)</a><a href="/gallery/candy/">网红馆(糖果画报)</a><a
                                href="/gallery/uxing/">优星馆</a><a href="/gallery/wings/">影私荟</a><a
                                href="/gallery/xiaoyu/">语画界</a><a href="/gallery/huayan/">花の颜</a><a
                                href="/gallery/leyuan/">星乐园</a><a href="/gallery/huayang/">花漾</a><a
                                href="/gallery/xingyan/">星颜社</a><a href="/gallery/ugirl/">尤果网</a><a
                                href="/gallery/aiyouwu/">尤果圈</a><a href="/gallery/youguo/">优果网</a><a
                                href="/gallery/tgod/">推女神</a><a href="/gallery/tuigirl/">推女郎</a><a
                                href="/gallery/bololi/">波萝社</a><a href="/gallery/kimoe/">激萌文化</a><a
                                href="/gallery/girlt/">果团网</a><a
                                href="/gallery/xiongchuan/">熊川纪信</a><a
                                href="/gallery/toutiao/">头条女神</a><a href="/gallery/youmei/">尤美</a><a
                                href="/gallery/mtgirl/">蜜团女孩</a><a href="/gallery/missleg/">蜜丝</a><a
                                href="/gallery/partycat/">轰趴猫</a><a href="/gallery/slady/">猎女神</a><a
                                href="/gallery/kela/">克拉女神</a><a
                                href="/gallery/51modo/">51modo</a><a
                                href="/gallery/rqstar/">RQ-STAR</a><a
                                href="/gallery/ysweb/">YS-Web</a><a href="/gallery/dgcc/">DGC</a><a
                                href="/gallery/bomb/">Bomb.tv</a><a
                                href="/gallery/misty/">@misty</a><a
                                href="/gallery/sabra/">Sabra.net</a><a href="/gallery/4kstar/">4K-STAR</a>
                        </li>
                    </ul>
                </div>
                <div class="tag_div">
                    <ul>
                        <li><a href="/gallery/yushi/">浴室</a><a href="/gallery/shatan/">沙滩</a><a
                                href="/gallery/yongchi/">泳池</a><a href="/gallery/huwai/">户外</a><a
                                href="/gallery/jiepai/">街拍</a><a href="/gallery/jiaju/">家居</a><a
                                href="/gallery/xuedi/">雪地</a><a href="/gallery/sifang/">私房照</a><a
                                href="/gallery/christmas/">圣诞</a><a
                                href="/gallery/chunjie/">春节</a><a href="/gallery/shamo/">沙漠</a><a
                                href="/gallery/yugang/">浴缸</a><a href="/gallery/wenquan/">温泉</a>
                        </li>
                    </ul>
                </div>
                <div class="tag_div">
                    <ul>
                        <li><a href="/gallery/sportillustrated/">体育画报</a><a
                                href="/gallery/bigcomic/">Weekly Big Comic Spirits</a><a
                                href="/gallery/champion/">Young Champion</a><a
                                href="/gallery/playboy/">Weekly Playboy</a><a
                                href="/gallery/young/">Young Magazine</a><a href="/gallery/jump/">Weekly
                            Young Jump</a></li>
                    </ul>
                </div>
            </div>
            <i class="lt"></i><i class="rt"></i></div>
        <div class="entry_box_b_arena"><i class="lb"></i><i class="rb"></i></div>
        <div class="clear12"></div>
        <div class="entry_box_arena">
            <div class="box_entry">
                <div class="box_entry_title">
                    <div class="hot_tag"><span id="stag">美女图片</span></div>
                </div>
                <div class="clear"></div><!-- thumbnail -->
                <div class="post_entry">
                    <div id="listdiv" class="listdiv">
                        <div style="height: 12px"></div>
                        <ul>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35266/"><img
                                        alt="[XiuRen] 2021.02.08 No.3097 周于希Sandy"
                                        data-original="https://t1.onvshen.com:85/gallery/24410/35266/cover/0.jpg"
                                        title="[XiuRen] 2021.02.08 No.3097 周于希Sandy"
                                        src="https://t1.onvshen.com:85/gallery/24410/35266/cover/0.jpg"
                                        style="display: inline;"></a></div>
                                <div class="galleryli_title"><a href="/g/35266/" class="caption">[XiuRen]
                                    2021.02.08 No.3097 周于希Sandy</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35265/"><img
                                        alt="[XiuRen] 2021.02.02 No.3071 白茹雪Abby"
                                        data-original="https://t1.onvshen.com:85/gallery/27374/35265/cover/0.jpg"
                                        title="[XiuRen] 2021.02.02 No.3071 白茹雪Abby"
                                        src="https://t1.onvshen.com:85/gallery/27374/35265/cover/0.jpg"
                                        style="display: inline;"></a></div>
                                <div class="galleryli_title"><a href="/g/35265/" class="caption">[XiuRen]
                                    2021.02.02 No.3071 白茹雪Abby</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35264/"><img
                                        alt="[YOUMI] 2020.12.30 VOL.581 王雨纯"
                                        data-original="https://t1.onvshen.com:85/gallery/19702/35264/cover/0.jpg"
                                        title="[YOUMI] 2020.12.30 VOL.581 王雨纯"
                                        src="https://t1.onvshen.com:85/gallery/19702/35264/cover/0.jpg"
                                        style="display: inline;"></a></div>
                                <div class="galleryli_title"><a href="/g/35264/" class="caption">[YOUMI]
                                    2020.12.30 VOL.581 王雨纯</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35263/"><img
                                        alt="[FEILIN] 2021.01.25 No.371 桃香子"
                                        data-original="https://t1.onvshen.com:85/gallery/26917/35263/cover/0.jpg"
                                        title="[FEILIN] 2021.01.25 No.371 桃香子"
                                        src="https://t1.onvshen.com:85/gallery/26917/35263/cover/0.jpg"
                                        style="display: inline;"></a></div>
                                <div class="galleryli_title"><a href="/g/35263/" class="caption">[FEILIN]
                                    2021.01.25 No.371 桃香子</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35262/"><img
                                        alt="[HuaYang] 2020.12.30 VOL.344 徐安安"
                                        data-original="https://t1.onvshen.com:85/gallery/27828/35262/cover/0.jpg"
                                        title="[HuaYang] 2020.12.30 VOL.344 徐安安"
                                        src="https://t1.onvshen.com:85/gallery/27828/35262/cover/0.jpg"
                                        style="display: inline;"></a></div>
                                <div class="galleryli_title"><a href="/g/35262/" class="caption">[HuaYang]
                                    2020.12.30 VOL.344 徐安安</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35261/"><img alt="尤果圈合集情人多情"
                                                                                    data-original="https://t1.onvshen.com:85/gallery/23823/35261/cover/0.jpg"
                                                                                    title="尤果圈合集情人多情"
                                                                                    src="https://t1.onvshen.com:85/gallery/23823/35261/cover/0.jpg"
                                                                                    style="display: inline;"></a>
                                </div>
                                <div class="galleryli_title"><a href="/g/35261/" class="caption">尤果圈合集情人多情</a>
                                </div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35260/"><img
                                        alt="[XiuRen] 2021.02.05 No.3086 妲己_Toxic"
                                        data-original="https://t1.onvshen.com:85/gallery/22359/35260/cover/0.jpg"
                                        title="[XiuRen] 2021.02.05 No.3086 妲己_Toxic"
                                        src="https://t1.onvshen.com:85/gallery/22359/35260/cover/0.jpg"
                                        style="display: inline;"></a></div>
                                <div class="galleryli_title"><a href="/g/35260/" class="caption">[XiuRen]
                                    2021.02.05 No.3086 妲己_Toxic</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35259/"><img
                                        alt="[XiuRen] 2021.01.29 No.3062 芝芝Booty"
                                        data-original="https://t1.onvshen.com:85/gallery/22899/35259/cover/0.jpg"
                                        title="[XiuRen] 2021.01.29 No.3062 芝芝Booty"
                                        src="https://t1.onvshen.com:85/gallery/22899/35259/cover/0.jpg"
                                        style="display: inline;"></a></div>
                                <div class="galleryli_title"><a href="/g/35259/" class="caption">[XiuRen]
                                    2021.01.29 No.3062 芝芝Booty</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35258/"><img
                                        alt="[XiuRen] 2021.01.25 No.3039 方子萱"
                                        data-original="https://t1.onvshen.com:85/gallery/22469/35258/cover/0.jpg"
                                        title="[XiuRen] 2021.01.25 No.3039 方子萱"
                                        src="https://t1.onvshen.com:85/gallery/22469/35258/cover/0.jpg"
                                        style="display: inline;"></a></div>
                                <div class="galleryli_title"><a href="/g/35258/" class="caption">[XiuRen]
                                    2021.01.25 No.3039 方子萱</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35257/"><img
                                        alt="[XiuRen] 2021.01.25 No.3037 奶油妹妹"
                                        data-original="https://t1.onvshen.com:85/gallery/28119/35257/cover/0.jpg"
                                        title="[XiuRen] 2021.01.25 No.3037 奶油妹妹"
                                        src="https://t1.onvshen.com:85/gallery/28119/35257/cover/0.jpg"
                                        style="display: inline;"></a></div>
                                <div class="galleryli_title"><a href="/g/35257/" class="caption">[XiuRen]
                                    2021.01.25 No.3037 奶油妹妹</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35256/"><img
                                        alt="[YOUMI] 2020.12.29 VOL.580 果儿Victoria"
                                        data-original="https://t1.onvshen.com:85/gallery/19551/35256/cover/0.jpg"
                                        title="[YOUMI] 2020.12.29 VOL.580 果儿Victoria"
                                        src="https://t1.onvshen.com:85/gallery/19551/35256/cover/0.jpg"
                                        style="display: inline;"></a></div>
                                <div class="galleryli_title"><a href="/g/35256/" class="caption">[YOUMI]
                                    2020.12.29 VOL.580 果儿Victoria</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35255/"><img
                                        alt="[HuaYang] 2020.12.29 VOL.343 王雨纯"
                                        data-original="https://t1.onvshen.com:85/gallery/19702/35255/cover/0.jpg"
                                        title="[HuaYang] 2020.12.29 VOL.343 王雨纯"
                                        src="https://t1.onvshen.com:85/gallery/19702/35255/cover/0.jpg"
                                        style="display: inline;"></a></div>
                                <div class="galleryli_title"><a href="/g/35255/" class="caption">[HuaYang]
                                    2020.12.29 VOL.343 王雨纯</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35254/"><img
                                        alt="芝芝Booty妩媚非凡 你的性感令人尖叫"
                                        data-original="https://t1.onvshen.com:85/gallery/22899/35254/cover/0.jpg"
                                        title="芝芝Booty妩媚非凡 你的性感令人尖叫"
                                        src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"></a>
                                </div>
                                <div class="galleryli_title"><a href="/g/35254/" class="caption">芝芝Booty妩媚非凡
                                    你的性感令人尖叫</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35253/"><img
                                        alt="[XiuRen] 2021.02.04 No.3081 模特合集"
                                        data-original="https://t1.onvshen.com:85/gallery/21017/35253/cover/0.jpg"
                                        title="[XiuRen] 2021.02.04 No.3081 模特合集"
                                        src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"></a>
                                </div>
                                <div class="galleryli_title"><a href="/g/35253/" class="caption">[XiuRen]
                                    2021.02.04 No.3081 模特合集</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35252/"><img
                                        alt="[XiuRen] 2021.01.28 No.3054 蜜桃cc"
                                        data-original="https://t1.onvshen.com:85/gallery/27534/35252/cover/0.jpg"
                                        title="[XiuRen] 2021.01.28 No.3054 蜜桃cc"
                                        src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"></a>
                                </div>
                                <div class="galleryli_title"><a href="/g/35252/" class="caption">[XiuRen]
                                    2021.01.28 No.3054 蜜桃cc</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35251/"><img
                                        alt="[XiuRen] 2021.01.27 No.3049 艾静香"
                                        data-original="https://t1.onvshen.com:85/gallery/27556/35251/cover/0.jpg"
                                        title="[XiuRen] 2021.01.27 No.3049 艾静香"
                                        src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"></a>
                                </div>
                                <div class="galleryli_title"><a href="/g/35251/" class="caption">[XiuRen]
                                    2021.01.27 No.3049 艾静香</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35250/"><img
                                        alt="[XiuRen] 2021.01.26 No.3043 玉兔miki"
                                        data-original="https://t1.onvshen.com:85/gallery/22186/35250/cover/0.jpg"
                                        title="[XiuRen] 2021.01.26 No.3043 玉兔miki"
                                        src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"></a>
                                </div>
                                <div class="galleryli_title"><a href="/g/35250/" class="caption">[XiuRen]
                                    2021.01.26 No.3043 玉兔miki</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35249/"><img
                                        alt="[HuaYang] 2020.12.28 VOL.342 允爾"
                                        data-original="https://t1.onvshen.com:85/gallery/28081/35249/cover/0.jpg"
                                        title="[HuaYang] 2020.12.28 VOL.342 允爾"
                                        src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"></a>
                                </div>
                                <div class="galleryli_title"><a href="/g/35249/" class="caption">[HuaYang]
                                    2020.12.28 VOL.342 允爾</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35248/"><img
                                        alt="[XiuRen] 2021.03.02 No.3155 杨晨晨sugar"
                                        data-original="https://t1.onvshen.com:85/gallery/22162/35248/cover/0.jpg"
                                        title="[XiuRen] 2021.03.02 No.3155 杨晨晨sugar"
                                        src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"></a>
                                </div>
                                <div class="galleryli_title"><a href="/g/35248/" class="caption">[XiuRen]
                                    2021.03.02 No.3155 杨晨晨sugar</a></div>
                            </li>
                            <li class="galleryli">
                                <div class="galleryli_div"><a class="galleryli_link"
                                                              href="/g/35247/"><img
                                        alt="[XiuRen] 2021.02.02 No.3070 小果冻儿"
                                        data-original="https://t1.onvshen.com:85/gallery/28069/35247/cover/0.jpg"
                                        title="[XiuRen] 2021.02.02 No.3070 小果冻儿"
                                        src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"></a>
                                </div>
                                <div class="galleryli_title"><a href="/g/35247/" class="caption">[XiuRen]
                                    2021.02.02 No.3070 小果冻儿</a></div>
                            </li>
                        </ul>
                        <div class="clear"></div>
                        <div class="pagesYY">
                            <div><a class="cur" href="/gallery/"><span></span>1</a><a
                                    href="/gallery/2.html"><span></span>2</a><a
                                    href="/gallery/3.html"><span></span>3</a><a
                                    href="/gallery/4.html"><span></span>4</a><a
                                    href="/gallery/5.html"><span></span>5</a><a
                                    href="/gallery/2.html"><span></span>下一页</a></div>
                        </div>
                    </div>
                </div>
            </div>
            <i class="lt"></i><i class="rt"></i></div>
        <div class="entry_box_b_arena"><i class="lb"></i><i class="rb"></i></div>
        <div class="clear12"></div>
    </div>
    <script src="//pc.weizhenwx.com/pc/beitou-tf.js" id="beitouid" data="s=3501"></script>
    <div class="clear"></div>
    <div class="footer_top">
        <div id="menu">
            <div class="menu-second-navi-container">
                <ul id="menu-second-navi" class="menu">
                    <li class="menu-item"><a href="/gallery/">高清美女图片</a></li>
                    <li class="menu-item"><a href="/gallery/xinggan/">性感美女图片</a></li>
                    <li class="menu-item"><a href="/gallery/meitun/">翘臀美女图片</a></li>
                    <li class="menu-item"><a href="/gallery/lengyan/">冷艳美女图片</a></li>
                    <li class="menu-item"><a href="/tag/hunxue/">混血女神</a></li>
                    <li class="menu-item"><a href="/tag/yazhou/">韩国女神</a></li>
                </ul>
            </div>
        </div>
        <h2 class="blogtitle"><a href="#" title="宅男女神">返回首页</a></h2></div>
    <div class="footer_bottom">
        <div class="footer"><p>
            本站所有资源来源于网友上传与分享,如有关内容侵犯了你的权益,请联系告之,我们会第一时间删除!邮箱:zngirls520@gmail.com</p>
            <p>© 2017-2019 nvshens.net, all rights reserved</p></div>
    </div>
    <div class="clear"></div>
</div>
<script src="//pc.weizhenwx.com/pc_w/m_beitou.js" id="beitoudata" data="s=3501"></script>
<script src="https://res.onvshen.com/script/common.js"></script>
<script src=" https://hm.baidu.com/h.js�49eefe9a0877491190a0c046ad94d1"
        type="text/javascript"></script>
<div id="HMcoupletDivleft"
     style="margin: 50px 0px 0px; padding: 0px; height: 0px; position: fixed; left: 0px; top: 0px; overflow: visible; width: 618px;">
    <a href="http://jg.wensixuetang.com/stf/visitor.html?id=173&amp;s=4103&amp;c=176711"
       class="jjjjasdasd" target="_blank"
       style="display:block;z-index:999999;float:none;text-align:right;opacity:1;position:relative;top:0px;right:500px"><img
            id="HMimageleft" style="border:0px;display:inline-block;width:auto;max-height:none;"
            onclick="HMcountClick()"
            src="//v.bjdgqx.com/syjpc/mjsg-txwjbgz-1080-420-3-19-l.gif"><img id="HMcoupletIconleft"
                                                                             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAQCAYAAAAFzx/vAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNpi1Oi7MZOBjoCJgc6AoIXXC9XTSDGQkHqCFmr235xFyBBSHMWIHofEagY5hFg9yGpZCCkgJgjRLcenn+JEQ4rjcPqQ0gSCTRzmMBZ6+o5iC4lNZAQTDTV9iu4gupc0VPEhKRmfBV+eokWQMg772gIgwADcMj5Lyf2sGwAAAABJRU5ErkJggg=="
                                                                             style="border:0px;display:inline-block;position:absolute;top:1315px;right:0px;z-index:999999;width:auto;"></a>
</div>
<div id="HMcoupletDivright"
     style="margin: 50px 0px 0px; padding: 0px; height: 0px; position: fixed; right: 0px; top: 0px; overflow: visible; width: 618px;">
    <a href="http://jg.wensixuetang.com/stf/visitor.html?id=173&amp;s=4103&amp;c=176711"
       class="jjjjasdasd" target="_blank"
       style="display:block;z-index:999999;float:none;text-align:left;opacity:1;position:relative;top:0px;left:500px"><img
            id="HMimageright" style="border:0px;display:inline-block;width:auto;max-height:none;"
            onclick="HMcountClick()"
            src="//v.bjdgqx.com/syjpc/mjsg-txwjbgz-1080-420-3-19-r.gif"><img id="HMcoupletIconright"
                                                                             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAQCAYAAAAFzx/vAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNpi1Oi7MZOBjoCJgc6AoIXXC9XTSDGQkHqCFmr235xFyBBSHMWIHofEagY5hFg9yGpZCCkgJgjRLcenn+JEQ4rjcPqQ0gSCTRzmMBZ6+o5iC4lNZAQTDTV9iu4gupc0VPEhKRmfBV+eokWQMg772gIgwADcMj5Lyf2sGwAAAABJRU5ErkJggg=="
                                                                             style="border:0px;display:inline-block;position:absolute;top:1315px;left:0px;z-index:999999;width:auto;"></a>
</div>
</body>
</html>

至此,这个简单的jsoup二次封装框架就完成了,如果各位大佬有更好的优化建议,还望大佬们不吝赐教。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,324评论 5 476
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,303评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,192评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,555评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,569评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,566评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,927评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,583评论 0 257
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,827评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,590评论 2 320
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,669评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,365评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,941评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,928评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,159评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,880评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,399评论 2 342

推荐阅读更多精彩内容