You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -267,29 +286,38 @@ export function getExtractionDomainGuidance(): string {
267
286
return`
268
287
269
288
IMPORTANT: Extraction Task Planning Rules
270
-
=========================================
271
-
For extraction tasks where data is already visible on the page:
289
+
========================================
272
290
273
-
1. If the data you need is VISIBLE in the page context above:
274
-
- Use EXTRACT directly as the ONLY step - no clicking needed
275
-
- The EXTRACT action will read the visible text from the page
291
+
STEP 1 - CHECK CURRENT URL:
292
+
Before choosing an action, compare the Current URL to the goal.
293
+
- Does the current page contain the data requested?
294
+
- If the goal mentions a specific section/page (e.g., "show hn", "top stories", "/show"), check if the URL matches.
295
+
- If you are NOT on the right page, NAVIGATE to the correct URL first.
276
296
277
-
2. If you need to navigate to see the data:
278
-
- First CLICK or NAVIGATE to the right page
279
-
- Then use EXTRACT
297
+
STEP 2 - EXTRACT VISIBLE DATA:
298
+
If the data is VISIBLE in the page context:
299
+
- Use EXTRACT directly - no clicking needed
300
+
- The EXTRACT action reads visible text from the current page
280
301
281
302
CRITICAL: Do NOT click on links to external sites when extracting.
282
303
- Post/article titles often link to EXTERNAL sites
283
304
- To extract a title that is visible, use EXTRACT directly on the current page
284
305
- Only click if you need to navigate to a detail page (e.g., for comments)
285
306
286
-
Example for "Extract the title of the first post":
287
-
{
288
-
"action": "EXTRACT",
289
-
"target": "first post title",
290
-
"goal": "Extract the first post title from the page",
291
-
"verify": []
292
-
}
307
+
Example - wrong page, need to navigate first:
308
+
Goal: "extract the title of the first showhn post on hackernews show"
309
+
Current URL: news.ycombinator.com/news (wrong page, need /show)
310
+
{"action":"NAVIGATE","target":"https://news.ycombinator.com/show","verify":[{"predicate":"url_contains","args":["show"]}],"reasoning":"navigate to Show HN page"}
311
+
312
+
Example - on correct page, extract directly:
313
+
Goal: "extract the title of the first showhn post"
314
+
Current URL: news.ycombinator.com/show (correct page, data visible)
315
+
{"action":"EXTRACT","target":"first ShowHN post title","goal":"Extract the title of the first ShowHN post","verify":[],"reasoning":"data is visible on current page"}
316
+
317
+
Example - product price on listing page:
318
+
Goal: "find the price of the first laptop"
319
+
Current URL: store.com/laptops (correct page, prices visible)
320
+
{"action":"EXTRACT","target":"price of first laptop","goal":"Extract the price of the first laptop listing","verify":[],"reasoning":"prices are visible in listing elements"}
0 commit comments