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

com.bytegriffin.get4j.sample.LetvPageParser Maven / Gradle / Ivy

package com.bytegriffin.get4j.sample;

import java.util.List;

import com.bytegriffin.get4j.Spider;
import com.bytegriffin.get4j.core.Page;
import com.bytegriffin.get4j.parse.PageParser;
import com.google.common.base.Splitter;

/**
 * 乐视-最新电影 jsonpath解析案例
 */
public class LetvPageParser implements PageParser {

	@Override
    public void parse(Page page) {
    	String ids = page.json("$.rec[0].videos[*].vid").replace("[", "").replace("]", "");
    	String titles = page.json("$.rec[0].videos[*].vidsubtitle").replace("[", "").replace("]", "");
    	List idList = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(ids);
    	List titleList = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(titles);
    	for(int n=0; n




© 2015 - 2025 Weber Informatics LLC | Privacy Policy