I would like help with the following:

I need to know how to automate a web browser (either Chrome, Firefox or Safari) to perform the following task.

Take a word from a .txt file housed on my hard drive, 1) put it into a search engine, 2) load the results, 3) click on/ open the first result, 4) open up an new tab and perform steps 1-3 again but with the next word from the .txt file. 4-5 second pauses are needed in between each step.

Additionally, I would like to automate the browser to close all the open tabs when a full stop is pulled from the .txt file.

I am using a macbook and 10.6.8 OS.

migrated from webapps.stackexchange.com Jul 14 '14 at 20:34

This question came from our site for power users of web applications.

  • full stop ...Did someone send you this text file by telegram? – Parthian Shot Jul 15 '14 at 0:15
  • You might want to take a look at Selenium for your browser automation. Some basic scripting or programming knowledge is required, though they do have a Firefox addon to help build it (you'll have to script the file reading/parsing logic yourself). – Bob Jul 15 '14 at 3:16

try the imarcos extension available for FF and chrome.


If you have access to writing applications in MONO on your mac, then the MONO run time actually follows the native .NET bindings in that it has a "Web-browser" component.

This Web-browser component (Like it's original native Windows .NET counterpart) encapsulates the systems default browser as a control that can be used in a visual or non-visual fashion.

It has methods such as "navigate(string)" which enable you to construct a URL from an arbitrary text string (EG: based on your words in your file), and it also has a "Document-text" property which allows you to grab the HTML content that was retrieved from the URL you navigated too.

Once you have that text, you can then use one of the many MONO HTML parsing tool kits available to grab the search results you need into something like an Array, which you can then do many things with, such as insert into a database.

I wrote a similar program a week or so ago, to grab the question list off the front page of Stack Overflow, admittedly I wrote it on Windows, using the official .NET stack, but it is very generic code so should work on a mac with the appropriately installed dependencies too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.