Skip to content

Conversation

@monadoid
Copy link
Contributor

@monadoid monadoid commented Jan 15, 2026

Just the example file - no helpers / custom code added.

Summary by cubic

Adds an example script that connects Pydoll to a Browserbase-backed Stagehand session over CDP, retrieves the current page’s frame_id, and uses it with observe and extract. This helps users run Pydoll and Stagehand in the same tab.

  • New Features
    • Added examples/pydoll_tab_example.py.
    • Normalizes CDP URL for Pydoll (ws vs wss) and attaches via Target.attachToTarget (flatten).
    • Enables Page/Runtime domains, performs simple navigation, then reads frame_id with Page.getFrameTree.
    • Documents required env vars (MODEL_API_KEY, BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID) and notes Python 3.10+ with pydoll-python.

Written for commit 346276a. Summary will update on new commits.

@monadoid monadoid merged commit 2cb0c28 into main Jan 15, 2026
6 of 8 checks passed
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="examples/pydoll_tab_example.py">

<violation number="1" location="examples/pydoll_tab_example.py:9">
P3: Duplicate docstring line with typo: `ePage.getFrameTree` should be removed. This line duplicates line 8 and contains an error (missing backtick, extra 'e').</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

- Attach Pydoll to the same browser via CDP (`cdp_url`)
- Use Pydoll to navigate
- Fetch the current page's `frame_id` via CDP `Page.getFrameTree`
- Fetch the current page's `frame_id` via CDP ePage.getFrameTree`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Duplicate docstring line with typo: ePage.getFrameTree should be removed. This line duplicates line 8 and contains an error (missing backtick, extra 'e').

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At examples/pydoll_tab_example.py, line 9:

<comment>Duplicate docstring line with typo: `ePage.getFrameTree` should be removed. This line duplicates line 8 and contains an error (missing backtick, extra 'e').</comment>

<file context>
@@ -0,0 +1,207 @@
+- Attach Pydoll to the same browser via CDP (`cdp_url`)
+- Use Pydoll to navigate
+- Fetch the current page's `frame_id` via CDP `Page.getFrameTree`
+- Fetch the current page's `frame_id` via CDP ePage.getFrameTree`
+- Pass `frame_id` into `session.observe/act/extract`
+
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants