<?php


namespace App\Services;


use QL\QueryList;

class YouKnowService
{
    /**
     *
     */
    public function scrape1024()
    {
        $baseUrl = "http://www.t66y.com/htm_data/1907/16/3575038.html";
        $albumSelector = "div.tpc_content.do_not_catch > input[type=image]";
        $baseQl = QueryList::get($baseUrl);
//        print_r($baseQl);
        $ql = $baseQl->find($albumSelector)->attrs("data-src");
        print_r($ql);
        foreach ($ql as $img) {
            $fileInfo = pathinfo($img);
            $content = file_get_contents($img);
            file_put_contents($fileInfo["filename"].".".$fileInfo["extension"], $content);
        }
    }
}