1.用scrapy新建一个tencent项目
2.在items.py中确定要爬去的内容

1 # -*- coding: utf-8 -*- 2 3 # Define here the models for your scraped items 4 # 5 # See documentation in: 6 # http://doc.scrapy.org/en/latest/topics/items.html 7 8 import scrapy 9 10 11 class TencentItem(scrapy.Item): 12 # define the fields for your item here like: 13 # 职位 14 position_name = scrapy.Field() 15 # 详情链接 16 positin_link = scrapy.Field() 17 # 职业类别 18 position_type = scrapy.Field() 19 # 招聘人数 20 people_number = scrapy.Field() 21 # 工作地点 22 work_location = scrapy.Field() 23 # 发布时间 24 publish_time = scrapy.Field()
3.在当前命令下创建一个名为tencent_spider的爬虫, 并指定爬取域的范围