1. 程式人生 > >Httpclient爬取優酷網

Httpclient爬取優酷網

num 內容 htm clas ets author download auth isod

參考:http://www.cnblogs.com/lchzls/p/6277210.html

/httpClient/src/main/java/com/louis/youku/Page.java

/**
 * Project Name:httpClient
 * File Name:Page.java
 * Package Name:com.louis.youku
 * Date:2017年11月9日上午9:11:28
 * Copyright (c) 2017, [email protected] All Rights Reserved.
 *
*/

package com.louis.youku;
/** * ClassName:Page * Function: TODO ADD FUNCTION. * Reason: TODO ADD REASON. * Date: 2017年11月9日 上午9:11:28 * @author michael * @version * @since JDK 1.7 * @see */ public class Page { //頁面內容 private String content; //總播放量 private String allnumber;
//每日播放增量 private String daynumber; //評論數 private String commentnumber; //收藏數 private String collectnumber; // private String supportnumber; // private String againstnumber; //電視劇名稱 private String tvname; //頁面url private String url;
//子集數據 private String episodenumber; public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getAllnumber() { return allnumber; } public void setAllnumber(String allnumber) { this.allnumber = allnumber; } public String getDaynumber() { return daynumber; } public void setDaynumber(String daynumber) { this.daynumber = daynumber; } public String getCommentnumber() { return commentnumber; } public void setCommentnumber(String commentnumber) { this.commentnumber = commentnumber; } public String getCollectnumber() { return collectnumber; } public void setCollectnumber(String collectnumber) { this.collectnumber = collectnumber; } public String getSupportnumber() { return supportnumber; } public void setSupportnumber(String supportnumber) { this.supportnumber = supportnumber; } public String getAgainstnumber() { return againstnumber; } public void setAgainstnumber(String againstnumber) { this.againstnumber = againstnumber; } public String getTvname() { return tvname; } public void setTvname(String tvname) { this.tvname = tvname; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getEpisodenumber() { return episodenumber; } public void setEpisodenumber(String episodenumber) { this.episodenumber = episodenumber; } }

/httpClient/src/main/java/com/louis/youku/DownLoadService.java

/**
 * Project Name:httpClient
 * File Name:DownLoadService.java
 * Package Name:com.louis.youku
 * Date:2017年11月9日上午9:14:16
 * Copyright (c) 2017, [email protected] All Rights Reserved.
 *
*/

package com.louis.youku;
/**
 * ClassName:DownLoadService 
 * Function: TODO ADD FUNCTION. 
 * Reason:     TODO ADD REASON. 
 * Date:     2017年11月9日 上午9:14:16 
 * @author   michael
 * @version  
 * @since    JDK 1.7
 * @see      
 */
public interface DownLoadService {
    public Page downLoad(String url);
}

/httpClient/src/main/java/com/louis/youku/DownLoadServiceImpl.java

/**
 * Project Name:httpClient
 * File Name:DownLoadService.java
 * Package Name:com.louis.youku
 * Date:2017年11月9日上午9:14:16
 * Copyright (c) 2017, [email protected] All Rights Reserved.
 *
*/

package com.louis.youku;
/**
 * ClassName:DownLoadService 
 * Function: TODO ADD FUNCTION. 
 * Reason:     TODO ADD REASON. 
 * Date:     2017年11月9日 上午9:14:16 
 * @author   michael
 * @version  
 * @since    JDK 1.7
 * @see      
 */
public interface DownLoadService {
    public Page downLoad(String url);
}

/httpClient/src/main/java/com/louis/youku/PageDownLoadUtil.java

/**
 * Project Name:httpClient
 * File Name:Page.java
 * Package Name:com.louis.youku
 * Date:2017年11月9日上午9:11:28
 * Copyright (c) 2017, [email protected] All Rights Reserved.
 *
*/

package com.louis.youku;
/**
 * ClassName:Page 
 * Function: TODO ADD FUNCTION. 
 * Reason:     TODO ADD REASON. 
 * Date:     2017年11月9日 上午9:11:28 
 * @author   michael
 * @version  
 * @since    JDK 1.7
 * @see      
 */
public class Page {
    //頁面內容
    private String content;
    
    //總播放量
    private String allnumber;
    
    //每日播放增量
    private String daynumber;
    
    //評論數
    private String commentnumber;

    //收藏數
    private String collectnumber;

    //
    private String supportnumber;

    //
    private String againstnumber;

    //電視劇名稱
    private String tvname;

    //頁面url
    private String url;

    //子集數據
    private String episodenumber;

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getAllnumber() {
        return allnumber;
    }

    public void setAllnumber(String allnumber) {
        this.allnumber = allnumber;
    }

    public String getDaynumber() {
        return daynumber;
    }

    public void setDaynumber(String daynumber) {
        this.daynumber = daynumber;
    }

    public String getCommentnumber() {
        return commentnumber;
    }

    public void setCommentnumber(String commentnumber) {
        this.commentnumber = commentnumber;
    }

    public String getCollectnumber() {
        return collectnumber;
    }

    public void setCollectnumber(String collectnumber) {
        this.collectnumber = collectnumber;
    }

    public String getSupportnumber() {
        return supportnumber;
    }

    public void setSupportnumber(String supportnumber) {
        this.supportnumber = supportnumber;
    }

    public String getAgainstnumber() {
        return againstnumber;
    }

    public void setAgainstnumber(String againstnumber) {
        this.againstnumber = againstnumber;
    }

    public String getTvname() {
        return tvname;
    }

    public void setTvname(String tvname) {
        this.tvname = tvname;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getEpisodenumber() {
        return episodenumber;
    }

    public void setEpisodenumber(String episodenumber) {
        this.episodenumber = episodenumber;
    }
    
}

Httpclient爬取優酷網