Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One of my most common tasks is:

1) Open a bunch of tabs

2) Copy and paste the URL from the address bar, as well as the body text, of each open tab into a text editor

Is there a way to script this from the Linux shell, even though I'm browsing in the GUI?

I get tired of having to do it all the time.

share|improve this question
Can you be more specific about what you're trying to do? Are the URLs in the address bar or in the body of the page? It might make a difference what browser you're using. The usual way to script retrieval and parsing of web pages is to start by retrieving the page using curl or wget. You don't say which operating system, but your use of the word "shell" seems to imply Linux/Unix. Please see How to Ask and How To Ask Questions The Smart Way. – Dennis Williamson Jan 31 '11 at 15:29
@Dennis Williamson done – ixtmixilix Jan 31 '11 at 23:09
up vote 0 down vote accepted

One possibility, if you don't mind downloading the same URLs twice, is to do something like this:

#!/bin/bash -e
for url in '' \
       # and so on
    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
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .