LoginSignup
3
5

More than 5 years have passed since last update.

scrapyでのBasic認証とフォームによる認証

Last updated at Posted at 2016-07-21

訳あってBasic認証とフォームによるユーザ認証がかかったCMSからスクレイピングする必要があったのでその際のメモ。

Basic認証(HTTP認証)

公式ドキュメント
settings.pyのDOWNLOADER_MIDDLEWARESでHttpAuthMiddlewareを有効にして、Spiderにhttp_userとhttp_passを追加すれば認証通る。

フォームによる認証

公式ドキュメント
公式のサンプルそのまま。

3
5
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
3
5