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

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

The newest version!
package com.bytegriffin.get4j.sample;

import com.bytegriffin.get4j.Spider;
import com.bytegriffin.get4j.core.Page;
import com.bytegriffin.get4j.parse.PageParser;

/**
 * 36氪
 * jsonpath的典型案例
 */
public class SanLiuKr implements PageParser {

    @Override
    public void parse(Page page) {
       System.err.println(page.getTitle() + "   " + page.getUrl() );
    }

    public static void main(String[] args) throws Exception {
        Spider.list_detail().fetchUrl("http://36kr.com/api/info-flow/main_site/posts?b_id=507750{1}&per_page=20")
        		.detailLinkSelector("http://36kr.com/p/$.data.items.id")
                .parser(SanLiuKr.class).thread(1).start();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy