チラウラヤーン3号

その辺のプログラマーのチラ裏です。

wget で POST メソッドでログインして Cookie を保存して、それを使う方法メモ

例によって StackOverflow の引用そのままで申し訳ないのですが…

How to get past the login page with wget? - Stack Overflow

# Log in to the server. This can be done only once.
wget --save-cookies cookies.txt \
--post-data 'user=foo&password=bar' \
http://server.com/auth.php

# Now grab the page or pages we care about.
wget --load-cookies cookies.txt \
-p http://server.com/interesting/article.php


You probably need to add --keep-session-cookies parameter as well.

(This topic would be probably more suited to superuser.com)

ですって。え、じゃぁ、Cookieを使ったログインに curl を使わなくてもいいのね。

そんで、 superuser.com ってサイトは、そういうのに使うのか。
3,4回しか見たこと無いけど、へー。

あ、いや、今なら httpie を使うのがいいのかな?あ、でも、再帰ダウンロードとかしたい場合あるし…うーむ。