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

Scrapy

scrapy support for sublime text

Details

Installs

  • Total 2K
  • Win 1K
  • Mac 387
  • Linux 308
Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 29 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13
Windows 0 0 0 0 0 0 0 0 1 1 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
Mac 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 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 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.