From 75cc7c284031646b012b50f4135249982f161bb5 Mon Sep 17 00:00:00 2001 From: Luc Gagan Date: Tue, 14 Nov 2023 08:57:21 -0600 Subject: [PATCH] feat: expand instructions to ensure unique selectors are used --- src/prompt.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/prompt.ts b/src/prompt.ts index a9a4369..6629501 100644 --- a/src/prompt.ts +++ b/src/prompt.ts @@ -9,7 +9,8 @@ import { TaskMessage } from "./types"; export const prompt = (message: TaskMessage) => { return `This is your task: ${message.task} -* Must always use locateElement function to find the element and reference it by elementId. +* When creating CSS selectors, ensure they are unique and specific enough to select only one element, even if there are multiple elements of the same type (like multiple h1 elements). +* Avoid using generic tags like 'h1' alone. Instead, combine them with other attributes or structural relationships to form a unique selector. Webpage snapshot: