Skip to content

Instantly share code, notes, and snippets.

@ecoopnet
ecoopnet / fetch_urls.sh
Last active April 4, 2024 02:34
指定したURLから再帰的にURLを取ってくるスクリプト
#!/bin/bash
# Usage: fetch_urls.sh "URL"
# Example: fetch_urls.sh "https://example.com/" | tee urls.txt
# https://example.com/ に再帰的にアクセスして、 urls.txt にURL一覧を書き出す
# Requirements: wget perl
# wget が入ってない場合、 brew install wget などでインストールして下さい。
_url="$1"
(
wget -nd -nH --spider --recursive --level=inf --no-verbose --execute robots=off "$_url" 2>&1