我的博客传送门(https://lzz1.top)查看效果
<?php
/**
* Created by PhpStorm.
* User: Lzz
* Date: 2019/2/28
* Time: 10:03
*/
class Haokan {
# 配置
protected $option = [
'url' => 'https://sv.baidu.com/',
'header' => [
'referer: https://sv.baidu.com/',
'user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1'
],
];
# dom
protected $xp;
# 分类
protected $fenlei=[];
# 获取到的视频链接
protected $vsrc=[];
public function __construct($option=[])
{
$this->option = array_merge($this->option,$option);
}
# 获取分类
public function get_fenlei(){
$list = $this->c_dom($this->option['url'])->xp->query('//div[@class="video-tabs-wrapper"]/ul/li/a');
php采集好看短视频,写入hexo博客
最新推荐文章于 2024-07-03 13:44:03 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)