定制 yqcode/querylist-ext-phantomjs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yqcode/querylist-ext-phantomjs

Composer 安装命令:

composer require yqcode/querylist-ext-phantomjs

包简介

QueryList V3 Plugin: Use PhantomJS to crawl Javascript dynamically rendered pages.(headless WebKit )

README 文档

README

QueryList V3 Plugin: Use PhantomJS to crawl Javascript dynamically rendered pages.(headless WebKit )

querylist-ext-phantomjs 安装

通过composer安装:

composer require huanyq2008/querylist-ext-phantomjs

querylist-ext-phantomjs 使用

下面演示QueryList用一句代码采集页面信息:

$urlarr = [
    'https://mimvp.com',  // 默认 utf-8
    'https://www.qq.com', // 默认 gb2312,需添加 header,否则乱码
    'https://www.dajie.com', // content在前,name在后,匹配错误(从第一个content开始,从最后一个name结束)
    'https://m.toutiao.com',
    'https://www.baidu.com',
    'https://mp.weixin.qq.com/s/NHD6BXCbJYzl4gK-NYBKaw',
];
//插件调用
$ql = QueryList::run('PhantomJs', [
    'binpath'=>'/usr/bin/phantomjs', 
    'url'=>$urlarr[0],
    'debug'=>false
]);
//设置规则
$data = $ql->setQuery(array(
    'title' => array('title','text'),
    'keywords' => array('meta[name=keywords]','content'),
    'description' => array('meta[name=description]','content'),
    'img' => array('img','src')
))->data;
print_r($data);

上面的代码实现的功能是采集相关页面的标题关键字描述图片,然后分别以二维关联数组的格式输出。

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固