wgetを使用してダウンロードするときに「他の」ドメインを無視しますか?

wgetを使用してダウンロードするときに「他の」ドメインを無視しますか?

www.website.com/XYZの下のリンクをクロールし、www.website.com/ABCの下のリンクだけをダウンロードしたいと思います。

目的のファイルを取得するには、次のwgetコマンドを使用しています。

wget  -I ABC -r -e robots=off --wait 0.25  http://www.website.com/XYZ

これはwget 1.13.4を使用すると完全に機能します。しかし、問題は、wget 1.11がインストールされているサーバーでこのコマンドを使用する必要があり、同じコマンドを使用すると、最終的に次のような別のドメインをダウンロードすることになります。

www.website.de 
www.website.it 
...

この問題をどのように回避できますか?使ってみよう

--exclude domains=www.website.de,www.website.it

しかし、これらのドメインを引き続きダウンロードしています。

また、必要なファイルが上位階層にあるため、これを使用できないことに注意してください--no-parent(website.com/XYZの下のリンクをスクラップしてwebsite.com/ABCの下からファイルをインポートしたい)。

どのようなヒントがありますか?

ベストアンサー1

あなたは反対を試す--max-redirect 0か使用することができます。--domains example.com--exclude-domains example.com

望むより:

  -D,  --domains=LIST              comma-separated list of accepted domains.
       --exclude-domains=LIST      comma-separated list of rejected domains.
       --follow-tags=LIST          comma-separated list of followed HTML tags.
       --ignore-tags=LIST          comma-separated list of ignored HTML tags.
  -np, --no-parent                 don't ascend to the parent directory.
  --max-redirect                   maximum redirections allowed per page.

おすすめ記事