简单实用的php爬虫系统

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/q601115211/article/details/52484623

通过简单的配置就爬取到网页内容,代码在github,欢迎大家一起使用。
* 代码提供的两个示例。由于网页改版,可能已经不能用了,下载后按自己的实际需求来修改正规提取规则
https://github.com/wxxiong6/crawl

php爬虫系统

  • 程序只支持CLI

安装程序

1.dbconfig.php 添加正确的数据库配置

2. 安装程序

php run install

启动程序

安装完成后,在setting表添加来源站点及正则提取规则。

启动程序 (参数是 setting 表id)

php run run 1 

清除项目数据

PHP
php run clear

完整代码目录

“`PHP

│ crawl.sql
│ LICENSE
│ README
│ run 系统入口程序

├─code
│ ├─config 配置文件
│ │ config.php
│ │ dbconfig.php
│ │
│ └─library 类库
│ │ App.php
│ │ Crawl.php
│ │ CrawlCallback.php
│ │ Import.php
│ │ Loader.php
│ │
│ └─db 数据库
│ MysqlPDO.php

├─data 数据

├─log 日志目录

├─tmp
└─web web目录

“`

猜你喜欢

转载自blog.csdn.net/q601115211/article/details/52484623
今日推荐