教程地址:https://www.runoob.com/w3cnote/scrapy-detail.html
# -*- coding: utf-8 -*-
import scrapy
class ItcastSpider(scrapy.Spider):
name = 'itcast'
allowed_domains = ['itcast.cn']
start_urls = ['http://itcast.cn/']
def parse(self, response):
filename = "teacher.html"
open(filename,"w").write(response.body)
scrapy crawl itcast 之后文件夹下什么都没有生成,也没有报错,
我用的python版本为3.7