ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Scrapy

by marco-lavagnino ST2/ST3

scrapy support for sublime text

Details

Installs

  • Total 1K
  • Win 790
  • OS X 295
  • Linux 229
Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3
Windows 0 1 2 1 0 1 0 1 1 0 0 1 3 0 2 0 0 0 0 0 1 1 0 0 0 2 2 2 0 1 0 0 1 0 2 3 1 1 0 0 0 0 0 0 0 2
OS X 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Scrapy Snippets for Sublime Text

This package provides handy snippets for working with scrapy, the python tool for making web spiders. It also provides palette commands for parsing request parameters from Postman.

Installation

Clone this package in your Packages/ directory. No Package Control support yet :)

Snippets

Snippets assume your spider has a BASE_URLattribute. This prevents code repetition and makes your code easily portable in case the website changes it's base url.

Snippets for the most common requests are provided: - Get: for sending a request with url request parameters, like mysite.com?parameter=value - Post: for X-www-Form-Urlencoded requests - Json: for POST requests with application/json content-type - A 'redirect' method, useful when you need to send a GET request without parameters. - A 'last' method that opens up the received response in the browser and starts an ipdb shell, useful for debugging the response or playing around with xpaths. - A asp parameter extractor, for easily getting __VIEWSTATE, __VIEWSTATEGENERATOR and __EVENTVALIDATION from a response.

Commands

Format from Postman

If you're using Postman to inspect your requests to a site, you can copy & paste the parameters in 'bulk-edit' mode, and paste them into your spider. Then, select all the lines you just pasted and from the command palette execute Scrapy: Format from Postman. The parameters will be formatted as python's dictionary keys and values.

Instance Item

Copy an item class definition in your spider. Then, select all the class definition lines and execute Scrapy: Yield Item. The definition will be formatted into a yield ClassInstance() statement.