You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
673 B

<?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);
}
}
}