Automate Google Searching of Terms in Different Tabs

google-search

I have a list of terms, each on a new line.

I need to Google search each one.

I have been copy and pasting each term invidivually into a new tab, but I was wondering if there was a way to automate it.

What is the easiest way to open a new tab for each term and search in on Google?

(I am on OSX. If any browser has an easy solution, I don't mind using it, but prefer Chrome if it doesn't matter.)

Best Answer

  • First, save the following code to a file:

    <html>
    <head>
    <title>MultiSearch</title>
    <script>
    function search()
    {
        var queries = document.getElementsByTagName('textarea')[0].value.split(/[\r\n]/);
        for(var i = 0, j = queries.length; i < j; i++)
            if(queries[i])
                window.open('http://www.google.com/search?q=' + queries[i]);
    }
    </script>
    </head>
    <body>
    <textarea style="height:90%;width:100%"></textarea>
    <input type="button" value="Search" onclick="search()">
    </body>
    </html>
    

    Now, open the file in your browser, paste the search terms (one per line) and click Search.

    This should work in most browsers. 

  • Related Question