scraoy 命令

官方文檔

scrapy   -h
  bench         Run quick benchmark test
  check         Check spider contracts
  commands
  crawl         Run a spider
  edit          Edit spider
  fetch         Fetch a URL using the Scrapy downloader
  genspider     Generate new spider using pre-defined templates
  list          List available spiders
  parse         Parse URL (using its spider) and print the results
  runspider     Run a self-contained spider (without creating a project)
  settings      Get settings values
  shell         Interactive scraping console
  startproject  Create new project
  version       Print Scrapy version
  view          Open URL in browser, as seen by Scrapy

Use "scrapy <command> -h" to see more info about a command

1、檢查語法

在這裏插入圖片描述

2、輸出抓取到的數據

scrapy   crawl ITtest

在這裏插入圖片描述

3、檢查是否可以檢查爬取

 scrapy   fetch  "https://hz.58.com/"

在這裏插入圖片描述

4、調試爬取頁面

scrapy   shell   "https://hz.58.com/"
 response.body.decode(response.encoding)

在這裏插入圖片描述
5、查看版本信息

scrapy   version

在這裏插入圖片描述

後期接着更新

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章