Search a website for every term in a Google Sheet and open the result


How to search a website for every term in a Google Sheet and open the result: install the Chrome extension, click Build with Browser agent, tell the agent what you want, and follow its prompts. A working bot is built and tested in minutes.

Here is how the automation works. To search a website for every term in a Google Sheet, loop through the rows with Loop through data, and for each one open the site, type the term into the search box with Enter text, submit it with Press key(s), and open the first result with Click element. From there the automation is on the page you wanted, so add whatever comes next: scrape it, fill a form, download a file. It is the opening move of a great many automations: looking a customer up in a CRM, a product in a catalogue, a name in a directory.

Author
Alex Barlow
Published

Build the search from a description


Describe it and click the button: the agent builds and tests the search in your Chrome extension. It asks for the site, finds the search box and the result link, and asks you if it is unsure.

  1. Read the search terms from my Google Sheet
  2. Open the site and search for each term
  3. Click the first result
  4. Delete the row once it is done
Click to launch the Chrome extension. Not installed? You can create an account and try it free.Opens the Chrome extension. Free account to try.

You need a Google Sheet with one search term per row in column A, with no header row, plus the URL of the page with the search box and a login for the site if it needs one. Leave the sheet as it is while the run deletes the rows it has searched.

Build the search step by step


The steps the agent builds, as the Builder shows them: each step by its name, with the fields to set under it. Add them yourself in this order in the step-by-step builder, or open the agent's result there to adjust it.

  • 1.0 Read data from a Google Sheet
    • Spreadsheet: your sheet
    • Sheet name: the tab with the search terms in column A
  • 2.0 Loop through data
    • repeats for every row in [google-sheet-data]
    • 2.1 Go to page
      • URL: the page with the search box
    • 2.2 Enter text
      • Select text field: the search box
      • Text: column A of [google-sheet-data]
    • 2.3 Press key(s)
      • Key: Enter
    • 2.4 Wait
      • Wait time: 2000
    • 2.5 Click element
      • Select: the first result's link
    • 2.6 Delete rows from a Google Sheet
      • Spreadsheet: your sheet
      • Sheet name: the tab with the search terms
      • First row: 1
      • Last row: 1

Common questions about searching a site for every term


Why is the search box not found, or the search term typed somewhere else?

The selector points at the wrong element. Click Select text field again and click the box itself. If the site opens the box with a click first, add a Click element step before Enter text. When a run fails, hand it to the agent and it repairs the step.

Why is the wrong search result clicked, or none at all?

The results had not loaded when the click ran. Raise Wait time on the Wait step, then reselect the first result's link in Click element. A custom CSS selector that matches the first result holds up better than a generated one.

What happens when a search term has no result?

The click fails and the run stops. Tick Optional click on the Click element step to carry on to the next term, or wrap the steps in a Try / Catch.

What can I do on the page after the search result opens?

Anything the site allows. The two most common: scrape the page into the sheet, or fill a form from the row.

Can I read the search terms from Excel or a CSV file instead?

Yes. Swap Read data from a Google Sheet for Read data from Excel or Import CSV File, and loop over its data instead. Drop the Delete rows from a Google Sheet step, which only works on a Google Sheet.

Can I search a website for a list of terms without code?

Yes. Every step in the search is a no-code step: the term is typed into the box, Enter is pressed, and the first result is clicked. Describe the site and the agent finds the search box and the result link.

Can I run the search on a schedule?

Yes. Save the automation and set a schedule. Each run works through the terms left in the sheet and deletes each one as it is searched, so terms added between runs are picked up by the next one.

Where do I get help?

Get in touch with support, or ask in the axiom.ai community.

Related guides