LoginSignup
33
34

More than 5 years have passed since last update.

web制作で使うwget

Last updated at Posted at 2014-02-12

ディレクトリ構造を保ったまま、HTMLのみをダウンロード

wget -x http://hoge.com/
wget -x http://hoge.com/report/
wget -x http://hoge.com/service/
wget -x http://hoge.com/portfolio/
wget -x http://hoge.com/press/
wget -x http://hoge.com/company/
wget -x http://hoge.com/recruit/

HTMLページを表示するのに必要なリソース一式を取得

wget -p http://hoge.com/

※css内で@importしているファイルまで取得する場合はこのオプションが必要

サイト丸ごとダウンロード

wget -r http://hoge.com/

リンクチェック

wget --spider --recursive --no-directories --no-verbose http://hoge.com/

ベーシック認証

wget -p --http-user={ID} --http-passwd={PW} http://hoge.com

!などの記号は\!のようにエスケープする

ユーザーエージェント(iOS6)

wget --user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25" http://hoge.com

別ドメインのファイルも取得

wget -p -H  http://m.hoge.com/

特定ディレクトリ以下を全てダウンロード

wget -r -np http://hoge.com/fuga/

拡張子を指定

wget -A jpg,gif http://hoge.com/fuga/

拡張子を除外

wget -R css http://hoge.com/fuga/
33
34
1

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
33
34