php 编写网络爬虫

WBOY
Release: 2016-06-23 13:32:07
Original
945 people have browsed it

pcntl_fork或者swoole_process实现多进程并发。按照每个网页抓取耗时500ms,开200个进程,可以实现每秒400个页面的抓取。

curl实现页面抓取,设置cookie可以实现模拟登录

simple_html_dom 实现页面的解析和DOM处理

如果想要模拟浏览器,可以使用casperJS。用swoole扩展封装一个服务接口给PHP层调用

在多玩网这里有一套爬虫系统就是基于上述技术方案实现的,每天会抓取几千万个页面。


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template