Scrapy 文档¶
本文档最初的翻译迁移自Scrapy 0.24的翻译,感谢初始译者。
本文档包含你需要知道的关于Scrapy的一切。
获取帮助¶
有麻烦吗?We’d like to help!
- 试试FAQ —— 它有一些常见问题的答案。
- 寻找具体的信息吗?试试Index或模块Index。
- 在StackOverflow中使用scrapy标签提出或搜索问题,
- 在scrapy-users的邮件列表归档中搜索信息,或者提出一个问题。
- 在#scrapy IRC channel中提问,
- 在issue tracker中提交Scrapy的bug。
第一步¶
- Scrapy at a glance
- 了解Scrapy是什么以及它可以如何帮助你。
- Installation guide
- 让Scrapy安装在你的计算机上。
- Scrapy教程
- 编写你的第一个Scrapy项目。
- Examples
- 通过把玩一个预制的Scrapy项目来学习更多内容。
基本概念¶
- 命令行工具
- 学习用于管理Scrapy项目的命令行工具。
- Spiders
- 编写爬取网站的规则。
- Selectors
- 使用XPath提取网页的数据。
- Scrapy shell
- 在交互环境中测试提取数据的代码。
- Items
- 定义你想要爬取的数据 。
- Item Loaders
- 使用爬取到的数据填充item。
- Item Pipeline
- 后期处理和存储爬取的数据。
- Feed exports
- 使用不同格式和存储输出爬取的数据。
- Requests and Responses
- 了解用于代表HTTP请求和响应的类。
- Link Extractors
- 提取链接来跟踪页面的方便的类。
- Settings
- 了解如何配置Scrapy以及所有可用的设置。
- Exceptions
- 查看可用的所有异常和它们的含义。
内置的服务¶
- Logging
- 了解在Scrapy上如何使用Python内置的logging。
- 统计数据收集
- 收集有关你的爬虫的统计信息。
- 发送电子邮件
- 当特定事件发生时发送邮件通知。
- Telnet终端
- 使用内置的Python终端检查运行中的爬虫。
- Web Service
- 使用web service监控和管理爬虫。
解决具体问题¶
- 常见问题
- 获取最常问的问题的解答。
- 调试Spiders
- 学习如何调试scrapy爬虫的常见问题。
- Spiders Contracts
- Learn how to use contracts for testing your spiders.
- Common Practices
- Get familiar with some Scrapy common practices.
- Broad Crawls
- 调整Scrapy来并发爬取多个域名。
- Using Firefox for scraping
- Learn how to scrape with Firefox and some useful add-ons.
- Using Firebug for scraping
- Learn how to scrape efficiently using Firebug.
- Debugging memory leaks
- Learn how to find and get rid of memory leaks in your crawler.
- Downloading and processing files and images
- 下载与你的爬取的项目相关的文件和/或图像。
- Ubuntu packages
- Install latest Scrapy packages easily on Ubuntu
- Deploying Spiders
- Deploying your Scrapy spiders and run them in a remote server.
- AutoThrottle extension
- Adjust crawl rate dynamically based on load.
- Benchmarking
- Check how Scrapy performs on your hardware.
- Jobs: pausing and resuming crawls
- Learn how to pause and resume crawls for large spiders.
扩展Scrapy¶
- Architecture overview
- Understand the Scrapy architecture.
- Downloader Middleware
- Customize how pages get requested and downloaded.
- Spider Middleware
- Customize the input and output of your spiders.
- Extensions
- Extend Scrapy with your custom functionality
- Core API
- Use it on extensions and middlewares to extend Scrapy functionality
- Signals
- See all available signals and how to work with them.
- Item Exporters
- Quickly export your scraped items to a file (XML, CSV, etc).
剩下的所有内容¶
- 发行说明
- 查看最近的Scrapy版本中有什么变化。
- 给Scrapy做贡献
- Learn how to contribute to the Scrapy project.
- 版本管理和API稳定性
- 了解Scrapy的版本管理和API的稳定性。