-
Notifications
You must be signed in to change notification settings - Fork 1.6k
update browser session docs #3776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds a new "Connect A Browser Session" subsection to the browser sessions introduction with a Python Playwright example that connects to an existing browser via CDP, enables download behavior, and navigates to a page. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer script
participant Playwright as Playwright Client
participant Browser as Remote Browser (CDP)
participant Page as Page / Context
Dev->>Playwright: sync_playwright() -> connect_over_cdp(browser_address)
Playwright->>Browser: Establish CDP connection
Note right of Browser#lightblue: New CDP session created\n(setDownloadBehavior)
Playwright->>Browser: new_cdp_session() / send("Page.setDownloadBehavior", ...)
Browser-->>Playwright: ack
Playwright->>Browser: get_browser_contexts() -> context[0]
Playwright->>Page: context[0].pages[0] -> navigate(url)
Page-->>Dev: page loaded / navigation result
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed everything up to ed9e0fc in 1 minute and 25 seconds. Click for details.
- Reviewed
39lines of code in1files - Skipped
0files when reviewing. - Skipped posting
1draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. fern/browser-sessions/introduction.mdx:47
- Draft comment:
Typographical error: The variable name 'browser_adress' is misspelled. It should be 'browser_address' to match the property and for consistency. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_mhCphASGK3JsIQzI
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed ed9e0fc in 1 minute and 41 seconds. Click for details.
- Reviewed
39lines of code in1files - Skipped
0files when reviewing. - Skipped posting
2draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. fern/browser-sessions/introduction.mdx:66
- Draft comment:
Indentation inconsistency: 'page.goto' is indented differently than the rest of the block. Ensure consistent indentation (spaces or tabs) for clarity. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While the comment is technically correct about the inconsistency, this is a documentation/example file (.mdx), not production code. The indentation inconsistency doesn't affect the readability of the example significantly. The comment feels overly pedantic for documentation. The inconsistent indentation could confuse readers trying to copy-paste the example. Bad formatting in documentation can propagate to user code. While true, the example will still work regardless of indentation style, and most IDEs will auto-format pasted code anyway. This isn't a critical issue worth flagging. The comment should be removed as it's too minor of an issue for documentation examples and doesn't impact functionality.
2. fern/browser-sessions/introduction.mdx:47
- Draft comment:
Typo: The variable 'browser_adress' is misspelled; it should be 'browser_address' to match its usage in line 51. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_6F12lzH0QMjcyB7f
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
fern/browser-sessions/introduction.mdx (1)
50-50: Minor formatting issues in code example.
- Line 50: Trailing
#comment marker with no text.- Line 66: Appears to have inconsistent indentation (likely tab vs. spaces).
Align these formatting issues with the rest of the example for clarity.
Apply this diff to clean up formatting:
-with sync_playwright() as playwright: # +with sync_playwright() as playwright:And ensure line 66 uses consistent indentation (spaces, not tabs):
context = browser.contexts[0] page = context.pages[0] - page.goto("https://www.skyvern.com") + page.goto("https://www.skyvern.com")Also applies to: 66-66
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
fern/browser-sessions/introduction.mdx(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Run tests and pre-commit hooks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
fern/browser-sessions/introduction.mdx (1)
50-50: Remove the trailing empty comment.Line 50 contains a trailing comment marker with no content (
#). Remove it for cleaner code.-with sync_playwright() as playwright: # +with sync_playwright() as playwright:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
fern/browser-sessions/introduction.mdx(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Run tests and pre-commit hooks
🔇 Additional comments (1)
fern/browser-sessions/introduction.mdx (1)
41-66: Excellent! Previous critical issue is fixed—approve the changes.The variable naming mismatch from previous reviews (
browser_adressvsbrowser_address) has been corrected. The code example is now syntactically sound and the variables are used consistently.
| ) | ||
| ``` | ||
|
|
||
| ## Connect A Browser Session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have a "Create a Browser Session" section at line 14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean? It's Connect
Important
Adds documentation for connecting a browser session using
playwright-pythoninintroduction.mdx.introduction.mdx.playwright-pythonto connect to a browser session and set download behavior via CDP.This description was created by
for ed9e0fc. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit