Search and Select an Item in a shopify store?

Hi there. I am new and experimenting while I teach myself.

I am attempting to create a bot that will search a shopify store for a defined product term a user defines in an excel file. Then selects the first instance of that search term. – It will then go on to add the item to the cart and checkout but I am stuck on simply selecting the item after it searches.

I can get my bot to this page I am using as an example: Search Results

“barrits” is the search term in this example

I would like the bot to click the first item in the list that pops up when the search is performed. MY first thought would be to just use the click element and define the selector- Since no matter what search term the user puts in, the results will be selectable items of the same shape and size (despite different names and images). This does not work the way I need. I can get this to work for the search term “barrits” but it is not flexible enough where if the user changes the search term then it still selects the first instance. - I assume because the name the website gives the object is important.

I am wondering how you all might go about achieving what I am trying to do, thank you.

Just to give you an idea o where I am headed with this: I will eventually want the bot to select the item and add it to the cart - but if there is no item from the search results I would want it to perform the search again and again continuously until either an item does pop up or the user aborts the bot.

The basic format you want to do is this:
Read excel sheet
Open browser to website
For each row in extracted data, grab search term
Type into search bar
check “Element exist” (search returns a result)
If exists click image and process, other wise continue (or just leave blank)

As far as your selector use this:
<html app='firefox.exe' title='* | Beverages Direct' /> <webctrl parentid='isp_search_results_container' tag='IMG' idx='1' />

This will always select the first image of a search (and only in the search menu). The * in the “title” means accept any combination of characters before the pipe. And idx=1 means grabs the first image. Use this for both element exist, as well as click

Thank you so much for your time and your help.

I have followed what you said I can not get the selector to validate. The only difference between mine and yours is that I switched out for chrome because I don’t have (and can’t install because of company policy) Firefox. I am not sure why this is happening. Below is a screenshot of what I have in for the selector