LoginSignup
0
0

More than 1 year has passed since last update.

Scrapy Shell の使い方

Last updated at Posted at 2022-02-23

Scrapy Shell とは

Scrapy のためのインタラクティブシェルで、CSS セレクターや XPath による抽出を簡単に試せる。
通常の Python のインタラクティブシェルと同様に Python のコードを実行できる。

起動方法

scrapy shell コマンドに URL を引数として与えることで起動。

$ scrapy shell https://****/****/****

関数

関数 内容
shelp() Scrapy Shell のヘルプを表示する。
fetch(url[, redirect=True])
or
fetch(req)
引数で指定した URL または Request オブジェクトのページを新しく取得し、requestresponse などの変数の値を置き換える。
view(response) 引数で指定した Response オブジェクトをブラウザで表示する。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0