本人安装PYTHON3.7安装位置:D:\Python\Python37
模板位置:D:\Python\Python37\Lib\site-packages\scrapy\templates\spiders
原来有:basic.tmpl ,crawl.tmpl,csvfeed.tmpl,xmlfeed.tmpl
用idle打开crawl.tmpl(打开类型选择*)
将自己的代码粘贴到文件中,并保存为crawlzj.tmpl
应用:

scrapy startproject mynew

cd mynew

scrapy genspider -t crawlzj mykai  baidu.com

则用自己的模板建立了一个爬虫,这样避免了重复代码的输入

相关文章:

  • 2021-04-15
  • 2022-01-12
  • 2022-02-04
  • 2022-12-23
  • 2021-09-29
  • 2021-06-01
  • 2021-10-02
  • 2022-12-23
猜你喜欢
  • 2022-02-25
  • 2021-05-17
  • 2021-10-09
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案