Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions examples/browser_scoped.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Example: browser-scoped client for browser VM process exec and raw HTTP."""

from kernel import Kernel

# After creating or loading a browser session (with base_url + cdp_ws_url from the API):
# browser = client.browsers.create(...)
# scoped = client.for_browser(browser)
# scoped.process.exec(command="uname", args=["-a"])
# r = scoped.request("GET", "https://example.com")
# with scoped.stream("GET", "https://example.com") as resp:
# print(resp.read())


def main() -> None:
_ = Kernel


if __name__ == "__main__":
main()
Loading