Files
tldr/pages.zh/common/scrapy.md

32 lines
779 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# scrapy
> 网络爬虫框架。
> 更多信息:<https://scrapy.org>。
- 创建一个项目:
`scrapy startproject {{project_name}}`
- 创建一个爬虫(在项目目录中):
`scrapy genspider {{spider_name}} {{website_domain}}`
- 编辑爬虫(在项目目录中):
`scrapy edit {{spider_name}}`
- 运行爬虫(在项目目录中):
`scrapy crawl {{spider_name}}`
- 按照 Scrapy 看到的方式获取网页并将源代码打印到 `stdout`
`scrapy fetch {{url}}`
- 按照 Scrapy 看到的方式在默认浏览器中打开网页(禁用 JavaScript 以提高准确性):
`scrapy view {{url}}`
- 为 URL 打开 Scrapy shell这允许在 Python shell如果可用则为 IPython中与页面源进行交互
`scrapy shell {{url}}`