安装
依赖环境
- Node.js V18.16.0+
- 包管理器:pnpm、yarn、npm
- VuePress Theme Hope 主题
创建项目
pnpm create vuepress-theme-hope test
大约 2 分钟
pnpm create vuepress-theme-hope test
sudo pip install virtualenv
sudo pip install virtualenvwrapper
Scrapy内置了一些通用的爬虫基类,你可以通过继承这些基类来快速构建自己的爬虫。这些内置爬虫基类提供了许多常用功能,比如:通过指定的规则,sitemaps或者xml/csv格式的feed文件爬取网站的链接。
接下来的例子,假定你已经创建了scrapy项目,在items.py
中申明TestItem类:
import scrapy
class TestItem(scrapy.Item):
id = scrapy.Field()
name = scrapy.Field()
description = scrapy.Field()
class scrapy.spiders.CrawlSpider