Stagehand agent to extract screenshots of Linkedin banner images#62
Stagehand agent to extract screenshots of Linkedin banner images#62
Conversation
Kylejeong2
left a comment
There was a problem hiding this comment.
TS version lgtm other than the fact that you can't use advanced stealth/proxies on a non-paid plan.
Also all of our templates are in both python/TS
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 3 total unresolved issues (including 1 from previous review).
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Wrong env var name breaks Stagehand client API key
- Updated
AsyncStagehandinitialization to readmodel_api_keyfromGOOGLE_API_KEYso extract uses the configured key.
- Updated
- ✅ Fixed: Missing prominent Scale plan requirement note per reviewer
- Added a prominent note at the top of README stating the example is for Browserbase Scale customers due to
advanced_stealth.
- Added a prominent note at the top of README stating the example is for Browserbase Scale customers due to
Or push these changes by commenting:
@cursor push bc5bd877a3
Preview (bc5bd877a3)
diff --git a/python/agent-screenshot/README.md b/python/agent-screenshot/README.md
--- a/python/agent-screenshot/README.md
+++ b/python/agent-screenshot/README.md
@@ -1,5 +1,7 @@
# Stagehand + Browserbase: LinkedIn Banner Screenshot
+> **Note:** This example is for Browserbase Scale customers only because it requires `advanced_stealth`.
+
## AT A GLANCE
- Goal: Given a company name, find its LinkedIn page via Google and extract a screenshot of its banner image.
diff --git a/python/agent-screenshot/main.py b/python/agent-screenshot/main.py
--- a/python/agent-screenshot/main.py
+++ b/python/agent-screenshot/main.py
@@ -85,7 +85,7 @@
client = AsyncStagehand(
browserbase_api_key=os.environ.get("BROWSERBASE_API_KEY"),
browserbase_project_id=os.environ.get("BROWSERBASE_PROJECT_ID"),
- model_api_key=os.environ.get("GOOGLE_GENERATIVE_AI_API_KEY"),
+ model_api_key=os.environ.get("GOOGLE_API_KEY"),
)
# ---------------------------------------------------------------------------This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
| client = AsyncStagehand( | ||
| browserbase_api_key=os.environ.get("BROWSERBASE_API_KEY"), | ||
| browserbase_project_id=os.environ.get("BROWSERBASE_PROJECT_ID"), | ||
| model_api_key=os.environ.get("GOOGLE_GENERATIVE_AI_API_KEY"), |
There was a problem hiding this comment.
Wrong env var name breaks Stagehand client API key
High Severity
The AsyncStagehand client reads model_api_key from GOOGLE_GENERATIVE_AI_API_KEY, but the .env.example, README, error messages, and even the comment on line 83–84 all reference GOOGLE_API_KEY. The agent config on line 169 also correctly uses GOOGLE_API_KEY. This mismatch means the client-level API key will always be None, causing the extract() call to fail since it depends on the client's model_api_key for the google/gemini-2.5-flash model.
Additional Locations (1)
3c489d7 to
d680219
Compare
d680219 to
d1befb6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 4 total unresolved issues (including 3 from previous reviews).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.



Somewhat niche, somewhat interesting use case built for another customer demo.
Imagining this as an example of how to leverage Stagehand to download random media assets on websites where a user would typically "right-click and press save image" (OS-level commands) that Stagehand can't mimic with acts, but can instead extract the image links, navigate to the link, and ultimately take a screenshot of it instead
Note
Low Risk
Low risk because this PR only adds new standalone Python/TypeScript example projects and supporting docs/config, without modifying existing application logic. Main risk is minor dependency/lockfile churn and potential confusion around required env vars/API keys.
Overview
Adds new
python/agent-screenshotandtypescript/agent-screenshotexamples that use a Stagehand CUA agent (via Browserbase with proxies/advanced stealth) to Google-search a company’s LinkedIn page, extract the banner image URL, and save a cropped screenshot toimages/.Includes project scaffolding and setup docs (
README.md,.env.example,.gitignore), plus Python packaging (pyproject.toml,uv.lock) and runnable entrypoints (main.py,index.ts).Written by Cursor Bugbot for commit 0922b56. This will update automatically on new commits. Configure here.