創(chuàng)建爬蟲項目
scrapy startproject 項目名
例子如下:
localhost:spider zhaofan$ scrapy startproject test1 New Scrapy project 'test1', using template directory '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/scrapy/templates/project', created in: /Users/zhaofan/Documents/python_project/spider/test1 You can start your first spider with: cd test1 scrapy genspider example example.com localhost:spider zhaofan$
這個時候爬蟲的目錄結(jié)構(gòu)就已經(jīng)創(chuàng)建完成了,目錄結(jié)構(gòu)如下:
|____scrapy.cfg|____test1| |___