コード例 #1
0
ファイル: Xieexiaozhan.php プロジェクト: deloz/botium
 public function detail(Response $res)
 {
     $title = $res->doc('h1.mhtitle.yahei')->text();
     $images = [];
     $res->doc('ul.mnlt > li#imgshow > img')->each(function (Crawler $node, $i) use(&$images, $res) {
         $img = $node->attr('src');
         if ($img) {
             $images[] = $img;
         }
     });
     $this->result(['title' => $title, 'images' => $images]);
 }
コード例 #2
0
ファイル: Haixiu.php プロジェクト: deloz/botium
 public function detail(Response $res)
 {
     $title = $res->doc('#content > h1')->text();
     $author = $res->doc('#content > div > div.article > div.topic-content.clearfix > div.topic-doc > h3 > span.from > a')->text();
     $images = [];
     $res->doc('div.topic-content > div.topic-figure.cc img')->each(function (Crawler $node, $i) use(&$images, $res) {
         $img = $node->attr('src');
         if ($img) {
             $images[] = $img;
         }
     });
     $this->result(['title' => $title, 'author' => $author, 'images' => $images]);
 }