转:http://www.cnblogs.com/in-loading/archive/2012/04/11/2442697.html
http://www.helloweba.com/view-blog-133.html
https://querylist.cc/question-9.html
https://querylist.cc/
<?php
29 $i = 1;
30 $url = "http://korea.b5m.com/clzx/news/22-".$i.".html";
31 //echo $url."\r\n";
32 require './queryList/jaeger/phpquery-single/phpQuery.php';
33 phpQuery::newDocumentFile($url);
34 $artlist = pq(".list-items>li");
35 foreach($artlist as $k=>$li){
36 //echo pq($li)->html()."===================";
37 //echo pq($li)->find('h3')->html()."\r\n\r\n";
38 $a[$k]["title"] = pq($li)->find('h3')->find("a")->text();
39 $a[$k]["link"] = pq($li)->find('h3')->find("a")->attr("href");
40 $info = pq($li)->find('p')->html();
41 $info = preg_replace('/<a href="(.*)" class="xq-btn" target="_blank">(.*)<\/a>/isU','',$info);
42 $a[$k]["info"] = $info;
43 $a[$k]["img"] = pq($li)->find('span:eq(0)')->find('a')->html();
44 $a[$k]["addtime"] = pq($li)->find('span:eq(3)')->html();
45 phpQuery::newDocumentFile($a[$k]["link"]);
46 $artlist = pq(".text-content");
47 foreach($artlist as $kk=>$li){
48 $a[$k]["content"] = pq($li)->html();
49 }
50 }
51 echo "<pre>";
52 print_r($a);
53 echo "</pre>";
54 ?>
1 <pre>Array
2 (
3 [0] => Array
4 (
5 [title] => MONSTAX确定21日发布新专辑 又一团体加入3月回归大战
6 [link] => http://korea.b5m.com/article-119285-1.html
7 [info] => 韩国男团MONSTA X确定将于21日发表新专辑,加入3月回归大战。 MONSTA X方面5日通过官方SNS公开了回归预告照,梦幻亮眼的视觉效果和“MONSTA X COMING SOON! THE CLAN 2.5 THE FINAL CHAPTER”文字令人视线集中。MON ......
8
9
10 [addtime] => 2017/03/06
11 [content] =>
12
13 <p class="MsoNormal"><span style="font-family: 宋体; line-height: 1.8em;">韩国男团</span><span lang="EN-US" style="font-family: 宋体; line-height: 1.8em;">MONSTA X</span><span style="font-family: 宋体; line-height: 1.8em;">确定将于</ span><span lang="EN-US" style="font-family: 宋体; line-height: 1.8em;">21</span><span style="font-family: 宋体; line-height: 1.8em;">日发表新专辑,加入</span><span lang="EN-US" style="font-family: 宋体; line-height: 1.8em;">3</span>< span style="font-family: 宋体; line-height: 1.8em;">月回归大战。</span></p>^M
14 ^M
15 <p class="MsoNormal" style="text-align: center;"><span lang="EN-US" style="font-family:宋体"> </span><a href="http://cdnweb.b5m.com/web/discuz/attachment/201703/06/125222v2742d0lwzzw44l4.jpg.shuiyin.jpg" target="_blank" style="line-h eight: 1.8em;"><img src="http://cdnweb.b5m.com/web/discuz/attachment/201703/06/125222v2742d0lwzzw44l4.jpg.shuiyin.jpg"></a></p>^M
16 ^M
17 <p class="MsoNormal"><span lang="EN-US" style="font-family:宋体">MONSTA X</span><span style="font-family:宋体">方面<span lang="EN-US">5</span>日通过官方<span lang="EN-US">SNS</span>公开了回归预告照,梦幻亮眼的视觉效果和“<span lang="E N-US">MONSTA X COMING SOON! THE CLAN 2.5 THE FINAL CHAPTER</span>”文字令人视线集中。<span lang="EN-US">MONSTA X</span>将通过讲述青春成长故事的<span lang="EN-US">THE CLAN Part.2.5</span>完结作展现他们的全新面貌,令粉丝们期待不已。<spa n lang="EN-US"><p></p></span></span></p>^M
18 ^M
19 <p class="MsoNormal"><span style="font-family:宋体">另外,<span lang="EN-US">MONSTA X</span>将于<span lang="EN-US">3</span>月<span lang="EN-US">21</span>日正式回归,新专辑制作已经进入尾声。</span><span lang="EN-US"><p></p></span></p>
20
21 )
23 [1] => Array
24 (
25 [title] => Highlight公开团体概念照 黑白风格引发粉丝强烈反响
26 [link] => http://korea.b5m.com/article-119284-1.html
27 [info] => 即将于20日发表首张迷你专辑的韩国男团Highlight于5日通过官方SNS公开了团体概念照,引发粉丝强烈反响。 Highlight此前依次公开了五位成员充满暖心魅力的个人概念照,而最新公开的团体概念照则通过黑白风格展现了别 ......
28
29
30 [addtime] => 2017/03/06
31 [content] =>
32
33 <p class="MsoNormal"><span style="font-family: 宋体; line-height: 1.8em;">即将于</span><span lang="EN-US" style="font-family: 宋体; line-height: 1.8em;">20</span><span style="font-family: 宋体; line-height: 1.8em;">日发表首张迷你专辑
的韩国男团</span><span lang="EN-US" style="font-family: 宋体; line-height: 1.8em;">Highlight</span><span style="font-family: 宋体; line-height: 1.8em;">于</span><span lang="EN-US" style="font-family: 宋体; line-height: 1.8em;">5</spa n><span style="font-family: 宋体; line-height: 1.8em;">日通过官方</span><span lang="EN-US" style="font-family: 宋体; line-height: 1.8em;">SNS</span><span style="font-family: 宋体; line-height: 1.8em;">公开了团体概念照,引发粉丝强烈反
响。</span></p>^M
34 ^M
35 <p class="MsoNormal" style="text-align: center;"><span lang="EN-US" style="font-family:宋体"> </span><a href="http://cdnweb.b5m.com/web/discuz/attachment/201703/06/124652uuzfptrjamrr7uml.jpg.shuiyin.jpg" target="_blank" style="line-h eight: 1.8em;"><img src="http://cdnweb.b5m.com/web/discuz/attachment/201703/06/124652uuzfptrjamrr7uml.jpg.shuiyin.jpg"></a></p>^M
36 ^M
37 <p class="MsoNormal"><span lang="EN-US" style="font-family:宋体">Highlight</span><span style="font-family:宋体">此前依次公开了五位成员充满暖心魅力的个人概念照,而最新公开的团体概念照则通过黑白风格展现了别样的春日氛围。继首轮概念照之> 后,<span lang="EN-US">Highlight</span>还将与<span lang="EN-US">6</span>日下午<span lang="EN-US">7</span>时至<span lang="EN-US">7</span>日零时(韩国时间),每隔<span lang="EN-US">1</span>小时发布一张第二波回归概念照,新风格令人期待。
<span lang="EN-US"><p></p></span></span></p>^M
38 ^M
39 <p class="MsoNormal"><span style="font-family:宋体">另外,<span lang="EN-US">Highlight</span>首张迷你专辑《<span lang="EN-US">CAN YOU FEEL IT?</span>》将于<span lang="EN-US">20</span>日发表,先行曲将于<span lang="EN-US">13</span>日率
先公开。</span><span lang="EN-US"><p></p></span></p>
40
41 )