NO IMAGE

抓取內容

文章作者資訊

也就是文章作者管理

客戶端提供文章作者首頁地址,http://www.toutiao.com/c/user/6310889977/ 通過如下方式可以獲取到作者資訊:

publicvoidtest2() {

        //寫手主頁

        String url = “http://www.toutiao.com/c/user/6310889977/”;

        //
文章詳情頁的字首(由於今日頭條的文章都是在group這個目錄下,所以定義了字首,而且通過請求獲取到的html頁面)

        //
連結到該網站

        Connection connection =Jsoup.connect(url);

        Document content = null;

        try {

            Map<String, String> cookies =new HashMap<String, String>();

            cookies.put(“UM_distinctid”,

                    “15d604b19ca3a2-0e6085b9900ead-1c197450-1fa400-15d604b19cb7b8”);

            cookies.put(“uuid”,
“w:a881896fbbd446bf9fc7c0c97434e78f”);

            cookies.put(“OUTFOX_SEARCH_USER_ID_NCOO”,
“1631109872.7671177”);

            cookies.put(“csrftoken”,
“59bd6e9979d9a0e447159c09c69ec182”);

            cookies.put(“_ga”,
“GA1.2.1128248025.1501125011”);

            cookies.put(“_gid”,
“GA1.2.1377010915.1501125011”);

            cookies.put(“__utmt”,
“1”);

            cookies.put(“__utma”,

                    “24953151.1128248025.1501125011.1501125474.1501125474.1”);

            cookies.put(“__utmb”,
“24953151.8.10.1501125474”);

            cookies.put(“__utmc”,
“24953151”);

            cookies.put(“__utmz”,

                    “24953151.15011254741.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)”);

            cookies.put(“tt_webid”,
“6444852342776890893”);

            cookies.put(“CNZZDATA1259612802”,

                    “478646998-1500557369-%7C1501121800”);

 

            connection

                    .header(“User-Agent”,

                            “Mozilla/5.0 (Windows NT 6.1; WOW64)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3100.0 Safari/537.36”);

 

            connection.cookies(cookies);

            //
獲取內容

   content = connection.get();

        } catch (IOException e) {

            e.printStackTrace();

        }

        //
轉換成字串

        String htmlStr = content.html();

        //
因為今日頭條的文章展示比較奇葩,都是通過js定義成變數,所以無法使用獲取dom元素的方式獲取值

        String jsonStr =StringUtils.substringBetween(htmlStr,

                “var userInfo = “,
“;”);

        System.out.println(jsonStr);

        Map parse = (Map)JSONObject.parse(jsonStr);

        Object id =  parse.get(“id”);

 

        //通過使用者id拼接查詢該作者的文章列表url

        String articleUrl = “http://www.toutiao.com/c/user/article/?page_type=1&user_id=”

                 id

                “&max_behot_time=0&count=30&as=A18539E7A918279&cp=5979A8F29759AE1”;

        System.out.println(“詳情url:” articleUrl);

輸出如下

{

    id: 6310889977,

    name: ‘愛豆表情’,

    avatarUrl: ‘http://p3.pstatp.com/thumb/411000fa6b181d3a25c’,

    isPgc: true,

    isBanned: false,

    isOwner: false,

    mediaId: 6311316427,

    type: ‘1’

  }

詳情url:http://www.toutiao.com/c/user/article/?page_type=1&user_id=6310889977&max_behot_time=0&count=30&as=A18539E7A918279&cp=5979A8F29759AE1

文章列表

抓取選擇作者的文章列表,在這裡需要使用到上面拼接的url,http://www.toutiao.com/c/user/article?page_type=1&user_id=6310889977&max_behot_time=0&count=30&as=A18539E7A918279&cp=5979A8F29759AE1這個url返回json,通過我們的json請求方式即可。

介紹一下url請求的引數:

  • page_type 0表示視訊,1表示文章
  • user_id 表示作者id
  • max_behot_time 這個欄位是用來翻頁使用的,預設資料是0,其實值就是時間戳/1000
  • count 每頁顯示記錄數
  • as 這個具體不太清楚
  • cp 這個具體不太清楚

響應資料詳解

這裡建議使用爬取的當前的時間戳作為max_behot_time 欄位的引數,為什麼要這樣,因為如果使用預設的值,則是按照閱讀數排序的,當重複爬取的時候不容易判斷重複。下面的資料是通過http://www.toutiao.com/c/user/article/?page_type=1&user_id=6310889977&max_behot_time=1501146065&count=2&as=A18539E7A918279&cp=5979A8F29759AE1獲取的

{

   “login_status”:
false,

   “has_more”:
true,

   “next”:
{

        “max_behot_time”: 1501046661

    },

   “page_type”:
1,

   “message”:
“success”,

   “data”:
[

        {

            “image_url”: “http://p1.pstatp.com/list/190×124/31c60002fe07a841314d”,

            “single_mode”:true,

            “abstract”: “要知道90後年齡最大的都有27歲了,正是適婚的時候,不過說起結婚,禮金這個問題就避免不了,不管是朋友結婚也好同學結婚也好,這份子錢還是都得隨了,而明星結婚也是如此,收禮金收到手軟,當梁朝偉和劉嘉玲結婚,王菲給15萬還算少的,但來看看趙本山,那才是真的豪氣!”,

            “middle_mode”: false,

            “more_mode”: true,

            “tag”: “news_entertainment”,

            “tag_url”: “news_entertainment”,

            “title”: “明星結婚給多少禮金?王菲給15萬算少的,趙本山才是真豪氣!”,

            “has_video”: false,

            “chinese_tag”:”娛樂”,

            “source”: “愛豆表情”,

            “group_source”:2,

            “comments_count”:78,

            “media_url”: “/m6311316427/”,

            “go_detail_count”:198964,

            “image_list”:[

                {

                    “url”:”http://p1.pstatp.com/list/31c60002fe07a841314d”,

                    “width”:1080,

                    “url_list”:[

                        {

                            “url”:”http://p1.pstatp.com/list/31c60002fe07a841314d”

                        },

                        {

                            “url”:”http://pb3.pstatp.com/list/31c60002fe07a841314d”

                        },

                        {

                            “url”:”http://pb9.pstatp.com/list/31c60002fe07a841314d”

                        }

                    ],

                    “uri”:”list/31c60002fe07a841314d”,

                    “height”:799

                },

                {

                    “url”:”http://p1.pstatp.com/list/31b9000303c0e7e03e26″,

                    “width”: 1080,

                    “url_list”:[

                        {

                            “url”:”http://p1.pstatp.com/list/31b9000303c0e7e03e26″

                        },

                        {

                            “url”:”http://pb3.pstatp.com/list/31b9000303c0e7e03e26″

                        },

                        {

                            “url”:”http://pb9.pstatp.com/list/31b9000303c0e7e03e26″

                        }

                    ],

                    “uri”: “list/31b9000303c0e7e03e26”,

                    “height”:727

                },

                {

                    “url”:”http://p1.pstatp.com/list/2ee300032db03ae5b319″,

                    “width”:1080,

                    “url_list”:[

                        {

                            “url”:”http://p1.pstatp.com/list/2ee300032db03ae5b319″

                        },

                        {

                            “url”:”http://pb3.pstatp.com/list/2ee300032db03ae5b319″

                        },

                        {

                            “url”:”http://pb9.pstatp.com/list/2ee300032db03ae5b319″

                        }

                    ],

                    “uri”:”list/2ee300032db03ae5b319″,

                    “height”:795

                }

            ],

            “gallary_image_count”:0,

            “detail_play_effective_count”:11,

            “source_url”: “/item/6446946448201220622/”,

            “item_id”: “6446946448201220622”,

            “article_genre”:”article”,

            “display_url”:”http://toutiao.com/preview_article/?pgc_id=6446946448201220622″,

            “behot_time”: 1501046691,

            “has_gallery”:false,

            “group_id”: “6446942793298510094”

        },

        {

            “image_url”: “http://p1.pstatp.com/list/190×124/31c70000e30f63f73da5”,

            “single_mode”:true,

            “abstract”: “時下《春風十里不如你》的開播在觀眾心目中可是千呼萬喚始出來。早在開拍之時,這部劇就引發了眾多關注和觀眾們的無限期待。張一山和周冬雨兩位年輕戲骨的組合讓觀眾紛紛好奇他們之間會擦出什麼樣的火花。而在熒幕上是小清新女神的周冬雨,微博晒照立馬暴露了自己的本性。”,

            “middle_mode”:false,

            “more_mode”: true,

            “tag”: “news_entertainment”,

            “tag_url”: “news_entertainment”,

            “title”: “周冬雨自拍晒豪宅,遊戲房搶鏡,但客廳卻暴露本性!”,

            “has_video”: false,

            “chinese_tag”:”娛樂”,

            “source”: “愛豆表情”,

            “group_source”:2,

            “comments_count”:281,

            “media_url”: “/m6311316427/”,

            “go_detail_count”:427439,

            “image_list”:[

                {

                    “url”:”http://p1.pstatp.com/list/31c70000e30f63f73da5″,

                    “width”:550,

                    “url_list”:[

                        {

                            “url”:”http://p1.pstatp.com/list/31c70000e30f63f73da5″

                        },

                        {

                            “url”:”http://pb3.pstatp.com/list/31c70000e30f63f73da5″

                        },

                        {

                            “url”:”http://pb9.pstatp.com/list/31c70000e30f63f73da5″

                        }

                    ],

                    “uri”:”list/31c70000e30f63f73da5″,

                    “height”:654

                },

                {

                    “url”:”http://p3.pstatp.com/list/2ee300032d6e1bbe7d4e”,

                    “width”:600,

                    “url_list”:[

                        {

                            “url”:”http://p3.pstatp.com/list/2ee300032d6e1bbe7d4e”

                        },

                        {

                            “url”:”http://pb9.pstatp.com/list/2ee300032d6e1bbe7d4e”

                        },

                        {

                            “url”:
“http://pb1.pstatp.com/list/2ee300032d6e1bbe7d4e”

                        }

                    ],

                    “uri”:”list/2ee300032d6e1bbe7d4e”,

                    “height”:506

                },

                {

                    “url”: “http://p1.pstatp.com/list/31c70000e30ea71c1110”,

                    “width”:400,

                    “url_list”:[

                        {

                            “url”:”http://p1.pstatp.com/list/31c70000e30ea71c1110″

                        },

                        {

                            “url”:”http://pb3.pstatp.com/list/31c70000e30ea71c1110″

                        },

                        {

                            “url”:”http://pb9.pstatp.com/list/31c70000e30ea71c1110″

                        }

                    ],

                    “uri”:”list/31c70000e30ea71c1110″,

                    “height”:448

                }

            ],

            “gallary_image_count”:0,

            “detail_play_effective_count”:5,

            “source_url”: “/item/6446946316734956046/”,

            “item_id”: “6446946316734956046”,

            “article_genre”:”article”,

            “display_url”:”http://toutiao.com/group/6446942632664498445/”,

            “behot_time”: 1501046661,

            “has_gallery”:false,

            “group_id”: “6446942632664498445”

        }

    ],

   “is_self”:
false

}

主要欄位介紹:

  • max_behot_time 下一頁開始的值
  • image_url 文章列表展示圖片的url
  • title 文章的標題
  • source 來源,作者名稱
  • go_detail_count 閱讀量
  • source_url 詳情url
  • item_id 文章id
  • behot_time 文章發表時間

重複抓取

考慮到文章將是大量的資料,而且結合前面通過時間戳進行查詢可以。我們可以通過制定規則,避免爬取時都將文章挨個比較。實現方式如下

我們制定的規則是每天爬取一次相關作者的文章

如果是第一次爬取該作者的文章,則請求列表的url的引數max_behot_time為當前時間戳/1000,自定義設定 count 欄位,建議不能超過50條。按照上面介紹的翻頁方式依次爬取。

如果爬取的作者已經爬取過文章,則請求列表的url的引數 max_behot_time 為當前時間戳/1000,自定義設定 count 欄位,建議不超過10條。將爬取處理的第一條(表示是最新的)資料的behot_time 欄位轉換成日期格式,轉換的時候需要*1000,如果第一條的釋出時間都不在今天的話,就無須在往後爬取了。

文章詳情

抓取文章的詳情,通過url http://www.toutiao.com/i6277404061113254402/ 這個url就是通過 http://www.toutiao.com和列表響應的source_url
拼接而成。獲取方式如下:

/**

    * 爬去文章詳情資訊

    */

    @Test

    publicvoid test1() {

        String url2= “http://www.toutiao.com/i6277404061113254402/”;

        Connectionconnection =
null;

        connection= Jsoup.connect(url2);

        try {

           Document document = connection.get();

            //
獲取文章標題

           Elements title = document.select(“[class=article-title]”);

           System.out.println(title.html());

            //
獲取文章來源和文章釋出時間

           Elements articleInfo = document.select(“[class=articleInfo]”);

           Elements src = articleInfo.select(“[class=src]”);

           System.out.println(src.html());

           Elements time = articleInfo.select(“[class=time]”);

            System.out.println(time.html());

            //
獲取文章內容

           Elements contentEle = document.select(“[class=article-content]”);

 

            Stringcontent = contentEle.html();

           System.out.println(content);

 

            //查詢文章的img標籤,並替換url

           Elements select = contentEle.select(“img[src]”);

           Iterator<Element> iterator = select.iterator();

            while(iterator.hasNext()){

               Element next = iterator.next();

               String attr = next.attr(“src”);

               content = content.replace(attr, attr “/abc”);

            }

 

           System.out.println(“\n替換url後\n”);

           System.out.println(content);

 

        } catch (IOException e) {

           e.printStackTrace();

        }

    }

看到周星馳這些表情,我竟然想哭了

愛豆表情

2016-04-2518:07

<div>

 <p>我心中永遠的藝術家,才華橫溢的導演就是周星馳了;雖然最近的這個美人魚不是我的喜歡,但是很是期待接下來更多周氏風格的作品!</p>

 <p>周星馳陪伴我們一路成長,下面這些動圖,你能回憶起幾張?</p>

 <p><imgsrc=”http://p3.pstatp.com/large/52d0005cda7a3dff492″ img_width=”400″
img_height=”224″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>來來來,還有一個雞腿留給你的</p>

 <p><imgsrc=”http://p1.pstatp.com/large/52e0005d01bb43cde93″ img_width=”300″
img_height=”184″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺越吹越過癮啊</p>

 <p><imgsrc=”http://p1.pstatp.com/large/52f0005cfc30f970ecc” img_width=”400″
img_height=”225″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>親個吻再拍</p>

 <p><imgsrc=”http://p1.pstatp.com/large/52c0005cddb2f3e19f2″ img_width=”400″
img_height=”225″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>隔山打牛,隔的人越多越厲害</p>

 <p><imgsrc=”http://p3.pstatp.com/large/41100099da8b6aca739″ img_width=”298″
img_height=”224″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺見到美女流口水</p>

 <p><imgsrc=”http://p3.pstatp.com/large/52f0005cfc4266c0ea4″ img_width=”397″
img_height=”214″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺要多帥就有多帥</p>

 <p><imgsrc=”http://p9.pstatp.com/large/5300005d205804a37bc” img_width=”375″
img_height=”200″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>哇靠!嚇得我辮子都直了</p>

 <p><imgsrc=”http://p1.pstatp.com/large/52f0005cfc5e4c4ac42″ img_width=”317″
img_height=”171″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>老兄,當心把肺都吐出來了</p>

 <p><imgsrc=”http://p1.pstatp.com/large/5300005d20690cb8ea2″ img_width=”296″
img_height=”168″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺教你如何優雅的比試柔道</p>

 <p><imgsrc=”http://p1.pstatp.com/large/52f0005cfc7ceeb3408″ img_width=”320″
img_height=”179″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺賭聖帥氣出場</p>

 <p><imgsrc=”http://p1.pstatp.com/large/5300005d207dc534168″ img_width=”320″
img_height=”179″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>國產007帥氣特工</p>

 <p><imgsrc=”http://p1.pstatp.com/large/5300005d209fd260b71″ img_width=”320″
img_height=”179″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>茶餐廳的靈魂,蛋撻王子!</p>

 <p><imgsrc=”http://p3.pstatp.com/large/52c0005cdddd9d27482″ img_width=”261″
img_height=”142″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>國產007周星馳看美女</p>

 <p><imgsrc=”http://p3.pstatp.com/large/41100099dacc7a9ab23″ img_width=”330″
img_height=”175″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>食神,我來了!</p>

 <p><imgsrc=”http://p3.pstatp.com/large/52c0005cddf788d6322″ img_width=”300″
img_height=”217″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>《師兄撞鬼》周星馳經典的的邪惡片段</p>

 <p><imgsrc=”http://p3.pstatp.com/large/41100099daedc49bd47″ img_width=”444″
img_height=”250″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>我左青龍,右邊虎,老牛在腰間,龍頭在心口…</p>

 <p><imgsrc=”http://p9.pstatp.com/large/52f0005cfc8e6b00351″ img_width=”320″
img_height=”180″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺,好一隻大力金剛腿</p>

 <p><imgsrc=”http://p1.pstatp.com/large/41100099db024fb4fb8″ img_width=”320″
img_height=”168″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>如花茹涼</p>

 <p><imgsrc=”http://p3.pstatp.com/large/4120009a1722dade61d” img_width=”280″
img_height=”151″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>周星馳彈小JJ</p>

 <p>一路陪伴我們的周星馳,曾教我們如何耍帥,如何撩妹,如果為自己所愛熱血奮鬥!</p>

 <p>每次看到這些圖,不得不感嘆,伴隨我們的是一份多麼美好的記憶!</p>

</div>

 

替換url後

 

<div>

 <p>我心中永遠的藝術家,才華橫溢的導演就是周星馳了;雖然最近的這個美人魚不是我的喜歡,但是很是期待接下來更多周氏風格的作品!</p>

 <p>周星馳陪伴我們一路成長,下面這些動圖,你能回憶起幾張?</p>

 <p><imgsrc=”http://p3.pstatp.com/large/52d0005cda7a3dff492/abc” img_width=”400″
img_height=”224″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>來來來,還有一個雞腿留給你的</p>

 <p><imgsrc=”http://p1.pstatp.com/large/52e0005d01bb43cde93/abc” img_width=”300″
img_height=”184″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺越吹越過癮啊</p>

 <p><imgsrc=”http://p1.pstatp.com/large/52f0005cfc30f970ecc/abc” img_width=”400″
img_height=”225″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>親個吻再拍</p>

 <p><imgsrc=”http://p1.pstatp.com/large/52c0005cddb2f3e19f2/abc” img_width=”400″
img_height=”225″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>隔山打牛,隔的人越多越厲害</p>

 <p><imgsrc=”http://p3.pstatp.com/large/41100099da8b6aca739/abc” img_width=”298″
img_height=”224″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺見到美女流口水</p>

 <p><imgsrc=”http://p3.pstatp.com/large/52f0005cfc4266c0ea4/abc” img_width=”397″
img_height=”214″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺要多帥就有多帥</p>

 <p><imgsrc=”http://p9.pstatp.com/large/5300005d205804a37bc/abc” img_width=”375″
img_height=”200″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>哇靠!嚇得我辮子都直了</p>

 <p><imgsrc=”http://p1.pstatp.com/large/52f0005cfc5e4c4ac42/abc” img_width=”317″
img_height=”171″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>老兄,當心把肺都吐出來了</p>

 <p><imgsrc=”http://p1.pstatp.com/large/5300005d20690cb8ea2/abc” img_width=”296″
img_height=”168″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺教你如何優雅的比試柔道</p>

 <p><imgsrc=”http://p1.pstatp.com/large/52f0005cfc7ceeb3408/abc” img_width=”320″
img_height=”179″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺賭聖帥氣出場</p>

 <p><imgsrc=”http://p1.pstatp.com/large/5300005d207dc534168/abc” img_width=”320″
img_height=”179″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>國產007帥氣特工</p>

 <p><imgsrc=”http://p1.pstatp.com/large/5300005d209fd260b71/abc” img_width=”320″
img_height=”179″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>茶餐廳的靈魂,蛋撻王子!</p>

 <p><imgsrc=”http://p3.pstatp.com/large/52c0005cdddd9d27482/abc” img_width=”261″
img_height=”142″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>國產007周星馳看美女</p>

 <p><imgsrc=”http://p3.pstatp.com/large/41100099dacc7a9ab23/abc” img_width=”330″
img_height=”175″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>食神,我來了!</p>

 <p><imgsrc=”http://p3.pstatp.com/large/52c0005cddf788d6322/abc” img_width=”300″
img_height=”217″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>《師兄撞鬼》周星馳經典的的邪惡片段</p>

 <p><imgsrc=”http://p3.pstatp.com/large/41100099daedc49bd47/abc” img_width=”444″
img_height=”250″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>我左青龍,右邊虎,老牛在腰間,龍頭在心口…</p>

 <p><imgsrc=”http://p9.pstatp.com/large/52f0005cfc8e6b00351/abc” img_width=”320″
img_height=”180″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>星爺,好一隻大力金剛腿</p>

 <p><img src=”http://p1.pstatp.com/large/41100099db024fb4fb8/abc” img_width=”320″
img_height=”168″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>如花茹涼</p>

 <p><imgsrc=”http://p3.pstatp.com/large/4120009a1722dade61d/abc” img_width=”280″
img_height=”151″ alt=”看到周星馳這些表情,我竟然想哭了” inline=”0″></p>

 <p>周星馳彈小JJ</p>

 <p>一路陪伴我們的周星馳,曾教我們如何耍帥,如何撩妹,如果為自己所愛熱血奮鬥!</p>

 <p>每次看到這些圖,不得不感嘆,伴隨我們的是一份多麼美好的記憶!</p>

</div>

注意點

這裡是有了jsoup 這個工具包還有解析json的工具包,記得引入maven座標:

<dependency>

    <groupId>org.jsoup</groupId>

    <artifactId>jsoup</artifactId>

    <version>1.10.3</version>

</dependency>

<dependency>

    <groupId>com.alibaba</groupId>

    <artifactId>fastjson</artifactId>

    <version>1.2.27</version>

</dependency>