# 如何实现多任务爬虫？

### 如何实现多任务爬虫？ <a href="#ru-he-shi-xian-duo-ren-wu-pa-chong" id="ru-he-shi-xian-duo-ren-wu-pa-chong"></a>

天下爬虫，唯快不破，配合多进程使用，phpspider可以快到你怕，下面我们来看看如何实现一个多任爬虫.

举个栗子：\
同时开启8个任务

```
$configs = array(
    'name' => '糗事百科测试样例',
    'tasknum' => 8,   // 爬虫任务数
    ...
);
$spider = new phpspider($configs);
$spider->start();
```

运行界面：\
![](/files/3Oxf87IdU7n5yEwwHMTG)

### results matching ""

*

### No results matching ""


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zhai-shi-sansorganization.gitbook.io/phpspider/ru-he-shi-xian-duo-ren-wu-pa-chong.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
