実際、私はかなり似たようなことをします。
GreaseMonkeyを使用すると、必要に応じてページを操作するユーザースクリプトを作成できます。次のページのリンクを取得して、好きなようにスクロールできます。
GM_getValueおよびGM_setValueと呼ばれるいくつかの新しい関数を使用して、Firefox内に任意のデータをローカルに保存することもできます。
私は怠惰な方法を取ります。ページをナビゲートするときに見つけたURLの長いリストを生成するだけです。私は大雑把な「document.write」メソッドを実行し、URLのリストをを規定するバッチファイルとしてダンプしますwget
。
その時点で、バッチファイルをコピーして貼り付けて実行します。
自動化するのに十分な頻度でこれを実行する必要がある場合は、GreaseMonkeyスクリプトをFirefox拡張機能に変換する方法がありました。これにより、より多くの機能にアクセスできます。
もう1つのオプションは、現在AFAIK、Chromeのみです。必要な情報を収集し、そこから大きなファイルを作成しdownload
、リンクの属性を使用して、シングルクリックで保存することができます。
アップデート
私が行っていたコード全体を共有するつもりでしたが、特定のWebサイトに関連付けられていたため、実際には役に立たなかったので、より「一般的な」ソリューションを選択します。
警告、このコードはその場で入力されたものであり、実際には正しくない可能性があります。
// Define the container
// If you are crawling multiple pages, you'd want to load this from
// localStorage.
var savedLinks = [];
// Walk through the document and build the links.
for (var i = 0; i < document.links.length; i++) {
var link = document.links[i];
var data = {
url: link.url,
desc = getText(link)
};
savedLinks.push(data);
}
// Here you'd want to save your data via localStorage.
// If not on the last page, find the 'next' button and load the next page
// [load next page here]
// If we *are* on the last page, use document.write to output our list.
//
// Note: document.write totally destroys the current document. It really is quite
// an ugly way to do it, but in this case it works.
document.write(JSON.stringify(savedLinks, null, 2));