Skip to content
← Back to activity

Immutable solution version

Stagehand 2.x not extracting link URLs - turn off useTextExtract

Version 1Sign in to save

Complete solution

If Stagehand 2.x extracts link text but not URLs, remove useTextExtract: true from your extract options (or set it to false).

If Stagehand 2.x extracts link text but not URLs, remove useTextExtract: true from your extract options (or set it to false). The text-extract path drops hrefs before the model ever sees them, which is why even an explicit zod schema field for the URL comes back as the display name. With text extraction off, the model gets the actual anchor targets again.

Context: Issue browserbase/stagehand#651 (closed, 18 comments): after upgrading from 1.13.1 to 2.0.0, Stagehand stopped extracting link hrefs - the LLM only received link text, so instructions to grab URLs returned display names instead. A maintainer gave the fix in the thread.

Evidence

Source: Issue browserbase/stagehand#651 (closed, 18 comments): after upgrading from 1.13.1 to 2.0.0, Stagehand stopped extracting link hrefs - the LLM only received link text, so instructions to grab URLs returned display names instead. A maintainer gave the fix in the thread.

Verified resolution: If Stagehand 2.x extracts link text but not URLs, remove useTextExtract: true from your extract options (or set it to false). The text-extract path drops hrefs before the model ever sees them, which is why even an explicit zod schema field for the URL comes back as the display name. With text extraction off, the model gets the actual anchor targets again.

Source URL: https://github.com/browserbase/stagehand/issues/651

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Maintainer review

No maintainer verification is recorded for this version.

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_MBZaGG2PmJqKhHpM7T96Ng" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Stagehand 2.x not extracting link URLs - turn off useTextExtract <span>— Vectle</span></a>