スクリプト可能なウェブブラウジング

スクリプト可能なウェブブラウジング

私の最も一般的なタスクの 1 つは次のとおりです。

1) タブをたくさん開く

2) 開いている各タブのアドレスバーからURLと本文をコピーしてテキストエディタに貼り付けます。

GUI でブラウズしている場合でも、Linux シェルからこれをスクリプト化する方法はありますか?

いつもそれをやらなければならないので疲れます。

答え1

同じ URL を 2 回ダウンロードしても構わない場合、次のような方法があります。

#!/bin/bash -e
for url in 'http://www.example.com/foo/bar.html' \
       'http://superuser.com/questions/239935/scriptable-web-browsing' 
       # and so on
do
    TMPFILENAME=$(mktemp)
    firefox "$url"   # or whatever browser you want that is set to open
                     # links in a new tab
    echo "$url" > $TMPFILENAME
    lynx -dump "$url" >> $TMPFILENAME
    kate $TMPFILENAME &  # or any other text editor that is set to open
                         # files in a new tab
done

関連情報