# 12-pyspider框架的使用

前文基本上把爬虫的流程实现一遍，将不同的功能定义成不同的方法，甚至抽象出模块的概念。如微信公众号爬虫，我们已经有了爬虫框架的雏形，如调度器、队列、请求对象等，但是它的架构和模块还是太简单，远远达不到一个框架的要求。如果我们将各个组件独立出来，定义成不同的模块，也就慢慢形成了一个框架。有了框架之后，我们就不必关心爬虫的全部流程，异常处理、任务调度等都会集成在框架中。我们只需要关心爬虫的核心逻辑部分即可，如页面信息的提取、下一步请求的生成等。这样，不仅开发效率会提高很多，而且爬虫的健壮性也更强。

在项目实战过程中，我们往往会采用爬虫框架来实现抓取，这样可提升开发效率、节省开发时间。pyspider 就是一个非常优秀的爬虫框架，它的操作便捷、功能强大，利用它我们可以快速方便地完成爬虫的开发。


---

# 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://python3webspider.cuiqingcai.com/12pyspider-kuang-jia-de-shi-yong.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.
