(May-24-2019, 11:41 PM)Truman Wrote: this is what I get when working on the tutorial.Have you made the project(
scrapy startproject tutorial
) and run it in right folder?(May-24-2019, 11:41 PM)Truman Wrote: C:\Python36\kodovi>This is not the right folder,
startproject
command over make a folder tutorial
You most read the tutorial again and follow every step.
Here some navigation,i use cmder.
# Top folder after run "scrapy startproject tutorial" # Here you run "scrapy crawl quotes" E:\div_code\scrapy_files\tutorial λ ls scrapy.cfg tutorial/ # cd in E:\div_code\scrapy_files\tutorial λ cd tutorial\ # Files in tutorial folder E:\div_code\scrapy_files\tutorial\tutorial λ ls __init__.py __pycache__/ items.py middlewares.py pipelines.py settings.py spiders/ # cd in E:\div_code\scrapy_files\tutorial\tutorial λ cd spiders\ # Files in spider folder E:\div_code\scrapy_files\tutorial\tutorial\spiders λ ls __init__.py __pycache__/ quotes_spider.py # This is a file you make "quotes_spider.py" E:\div_code\scrapy_files\tutorial\tutorial\spiders λ cat quotes_spider.py import scrapy class QuotesSpider(scrapy.Spider): name = "quotes" def start_requests(self): urls = [ 'http://quotes.toscrape.com/page/1/', 'http://quotes.toscrape.com/page/2/', ] for url in urls: yield scrapy.Request(url=url, callback=self.parse) def parse(self, response): page = response.url.split("/")[-2] filename = 'quotes-%s.html' % page with open(filename, 'wb') as f: f.write(response.body) self.log('Saved file %s' % filename) E:\div_code\scrapy_files\tutorial\tutorial\spiders