From 344e788c988d7e76c2c1b1e9ad68b0f7a5479706 Mon Sep 17 00:00:00 2001 From: "tembo[bot]" <208362400+tembo-io[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 18:22:25 +0000 Subject: [PATCH 1/8] docs: update scrapybara migration guide with computer controls Co-authored-by: null <> --- migrations/scrapybara.mdx | 73 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/migrations/scrapybara.mdx b/migrations/scrapybara.mdx index c107a17..7fe97ce 100644 --- a/migrations/scrapybara.mdx +++ b/migrations/scrapybara.mdx @@ -15,6 +15,9 @@ title: "Scrapybara" | **Stealth Mode** | ❌ Not available | Create browser with `stealth: true` | | **Replays** | ❌ Not available | `client.browsers.replays.start()` and `client.browsers.replays.stop()` | | **Save Auth** | `instance.browser.save_auth(name="default")` | Create [Profile](/browsers/profiles). Then create browser with `kernel.browsers.create(profile={"name": "profile1", "save_changes": True})` | +| **Click** | `instance.browser.computer.click_mouse(x=100, y=200)` | `client.browsers.computer.click_mouse(id=session_id, x=100, y=200)` | +| **Drag** | `instance.browser.computer.drag_mouse(path=[(100,100), (200,200)])` | `client.browsers.computer.drag_mouse(id=session_id, from_x=100, from_y=100, to_x=200, to_y=200)` | +| **Screenshot** | `instance.screenshot()` or `instance.browser.computer.take_screenshot()` | `client.browsers.computer.capture_screenshot(id=session_id)` | ## How to migrate @@ -138,6 +141,68 @@ browser2 = await client.browsers.create( ) ``` +### Computer Controls + +Both Scrapybara and Kernel provide Computer Controls APIs that allow you to programmatically control the browser environment at the system level - including mouse movements, clicks, keyboard input, and screenshots. Kernel has expanded on this functionality with a comprehensive set of computer control methods. + +**Scrapybara** +```python +instance = client.start_browser() + +# Click at specific coordinates +instance.browser.computer.click_mouse(x=100, y=200) + +# Drag from one position to another +instance.browser.computer.drag_mouse( + path=[(100, 100), (200, 200)] +) + +# Type text +instance.browser.computer.type_text(text="Hello World") + +# Take a screenshot +screenshot = instance.browser.computer.take_screenshot() +``` + +**Kernel** +```python +browser = await client.browsers.create() + +# Click at specific coordinates with additional options +client.browsers.computer.click_mouse( + id=browser.session_id, + x=100, + y=200, + button="left", + click_type="click", + num_clicks=1 +) + +# Drag from one position to another +client.browsers.computer.drag_mouse( + id=browser.session_id, + from_x=100, + from_y=100, + to_x=200, + to_y=200 +) + +# Type text with optional delay +client.browsers.computer.type_text( + id=browser.session_id, + text="Hello World", + delay=100 +) + +# Take a screenshot (full screen or specific region) +screenshot = client.browsers.computer.capture_screenshot( + id=browser.session_id, + region={"x": 0, "y": 0, "width": 800, "height": 600} +) +``` + +For a complete reference of all available Computer Controls methods in Kernel, see the [Computer Controls documentation](/browsers/computer-controls). + ## Full API Comparison @@ -161,6 +226,14 @@ browser2 = await client.browsers.create( | **File Download** | Via browser, then `instance.file()` | `client.browsers.fs.read_file()` | | **Process Control** | `instance.bash()` | `client.browsers.process.*` | | **Proxy Support** | ❌ Not available | Create [Proxy](/proxies/overview#1-create-a-proxy). Then create browser with `client.browsers.create(proxy_id=proxy.id)` | +| **Click Mouse** | `instance.browser.computer.click_mouse(x=100, y=200)` | `client.browsers.computer.click_mouse(id=session_id, x=100, y=200)` | +| **Move Mouse** | `instance.browser.computer.move_mouse(x=100, y=200)` | `client.browsers.computer.move_mouse(id=session_id, x=100, y=200)` | +| **Drag Mouse** | `instance.browser.computer.drag_mouse(path=[(100,100), (200,200)])` | `client.browsers.computer.drag_mouse(id=session_id, from_x=100, from_y=100, to_x=200, to_y=200)` | +| **Scroll** | `instance.browser.computer.scroll(delta_x=0, delta_y=100)` | `client.browsers.computer.scroll(id=session_id, delta_x=0, delta_y=100)` | +| **Type Text** | `instance.browser.computer.type_text(text="Hello")` | `client.browsers.computer.type_text(id=session_id, text="Hello")` | +| **Press Key** | `instance.browser.computer.press_key(keys=["Ctrl", "t"])` | `client.browsers.computer.press_key(id=session_id, keys=["Ctrl+t"])` | +| **Take Screenshot** | `instance.browser.computer.take_screenshot()` | `client.browsers.computer.capture_screenshot(id=session_id)` | +| **Get Cursor Position** | `instance.browser.computer.get_cursor_position()` | Use `move_mouse` with tracking or CDP | --- From 63ce10aef7990cd55232acfc6c02589eb176c28d Mon Sep 17 00:00:00 2001 From: "tembo[bot]" <208362400+tembo-io[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 18:39:18 +0000 Subject: [PATCH 2/8] docs: update Scrapybara shutdown status to past tense --- migrations/scrapybara.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/scrapybara.mdx b/migrations/scrapybara.mdx index 7fe97ce..2be461e 100644 --- a/migrations/scrapybara.mdx +++ b/migrations/scrapybara.mdx @@ -2,7 +2,7 @@ title: "Scrapybara" --- -[Scrapybara](https://scrapybara.com/) is shutting down their virtual desktop and browser service on **October 15, 2025**. If you're currently using Scrapybara for browser automation, Kernel is here to help you migrate seamlessly. +[Scrapybara](https://scrapybara.com/) has shut down their virtual desktop and browser service as of **October 15, 2025**. If you were using Scrapybara for browser automation, Kernel is here to help you migrate seamlessly. ## Key Concepts From ade334a9b91ea923b68559effc2b3e5b4c956043 Mon Sep 17 00:00:00 2001 From: "tembo[bot]" <208362400+tembo-io[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 18:48:19 +0000 Subject: [PATCH 3/8] fix(docs): update Scrapybara migration examples per feedback --- migrations/scrapybara.mdx | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/migrations/scrapybara.mdx b/migrations/scrapybara.mdx index 2be461e..cbeff5f 100644 --- a/migrations/scrapybara.mdx +++ b/migrations/scrapybara.mdx @@ -143,7 +143,7 @@ browser2 = await client.browsers.create( ### Computer Controls -Both Scrapybara and Kernel provide Computer Controls APIs that allow you to programmatically control the browser environment at the system level - including mouse movements, clicks, keyboard input, and screenshots. Kernel has expanded on this functionality with a comprehensive set of computer control methods. +Both Scrapybara and Kernel provide Computer Controls APIs that allow you to programmatically control the browser environment at the system level - including mouse movements, clicks, keyboard input, and screenshots. **Scrapybara** ```python @@ -166,38 +166,36 @@ screenshot = instance.browser.computer.take_screenshot() **Kernel** ```python -browser = await client.browsers.create() +kernel_browser = await client.browsers.create() -# Click at specific coordinates with additional options +# Click at specific coordinates client.browsers.computer.click_mouse( - id=browser.session_id, + id=kernel_browser.session_id, x=100, - y=200, - button="left", - click_type="click", - num_clicks=1 + y=200 ) # Drag from one position to another client.browsers.computer.drag_mouse( - id=browser.session_id, - from_x=100, - from_y=100, - to_x=200, - to_y=200 + id=kernel_browser.session_id, + path=[[100, 200], [150, 220], [200, 260]], + button="left", + delay=0, + steps_per_segment=10, + step_delay_ms=50, + hold_keys=["Shift"] ) # Type text with optional delay client.browsers.computer.type_text( - id=browser.session_id, + id=kernel_browser.session_id, text="Hello World", delay=100 ) -# Take a screenshot (full screen or specific region) +# Take a screenshot screenshot = client.browsers.computer.capture_screenshot( - id=browser.session_id, - region={"x": 0, "y": 0, "width": 800, "height": 600} + id=kernel_browser.session_id ) ``` From e482459ae7f85160e126c1aa076dd5e814601628 Mon Sep 17 00:00:00 2001 From: "tembo[bot]" <208362400+tembo-io[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:41:46 +0000 Subject: [PATCH 4/8] fix(docs): update drag_mouse example in migration guide --- migrations/scrapybara.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/scrapybara.mdx b/migrations/scrapybara.mdx index cbeff5f..380e7fc 100644 --- a/migrations/scrapybara.mdx +++ b/migrations/scrapybara.mdx @@ -16,7 +16,7 @@ title: "Scrapybara" | **Replays** | ❌ Not available | `client.browsers.replays.start()` and `client.browsers.replays.stop()` | | **Save Auth** | `instance.browser.save_auth(name="default")` | Create [Profile](/browsers/profiles). Then create browser with `kernel.browsers.create(profile={"name": "profile1", "save_changes": True})` | | **Click** | `instance.browser.computer.click_mouse(x=100, y=200)` | `client.browsers.computer.click_mouse(id=session_id, x=100, y=200)` | -| **Drag** | `instance.browser.computer.drag_mouse(path=[(100,100), (200,200)])` | `client.browsers.computer.drag_mouse(id=session_id, from_x=100, from_y=100, to_x=200, to_y=200)` | +| **Drag** | `instance.browser.computer.drag_mouse(path=[(100,100), (200,200)])` | `client.browsers.computer.drag_mouse(id=session_id, path=[[100, 200], [150, 220], [200, 260]])` | | **Screenshot** | `instance.screenshot()` or `instance.browser.computer.take_screenshot()` | `client.browsers.computer.capture_screenshot(id=session_id)` | ## How to migrate @@ -226,7 +226,7 @@ For a complete reference of all available Computer Controls methods in Kernel, s | **Proxy Support** | ❌ Not available | Create [Proxy](/proxies/overview#1-create-a-proxy). Then create browser with `client.browsers.create(proxy_id=proxy.id)` | | **Click Mouse** | `instance.browser.computer.click_mouse(x=100, y=200)` | `client.browsers.computer.click_mouse(id=session_id, x=100, y=200)` | | **Move Mouse** | `instance.browser.computer.move_mouse(x=100, y=200)` | `client.browsers.computer.move_mouse(id=session_id, x=100, y=200)` | -| **Drag Mouse** | `instance.browser.computer.drag_mouse(path=[(100,100), (200,200)])` | `client.browsers.computer.drag_mouse(id=session_id, from_x=100, from_y=100, to_x=200, to_y=200)` | +| **Drag Mouse** | `instance.browser.computer.drag_mouse(path=[(100,100), (200,200)])` | `client.browsers.computer.drag_mouse(id=session_id, path=[[100, 200], [150, 220], [200, 260]])` | | **Scroll** | `instance.browser.computer.scroll(delta_x=0, delta_y=100)` | `client.browsers.computer.scroll(id=session_id, delta_x=0, delta_y=100)` | | **Type Text** | `instance.browser.computer.type_text(text="Hello")` | `client.browsers.computer.type_text(id=session_id, text="Hello")` | | **Press Key** | `instance.browser.computer.press_key(keys=["Ctrl", "t"])` | `client.browsers.computer.press_key(id=session_id, keys=["Ctrl+t"])` | From 069da24281f024f1fbbaa934b2e5f7d7baf03c03 Mon Sep 17 00:00:00 2001 From: "tembo[bot]" <208362400+tembo-io[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:47:47 +0000 Subject: [PATCH 5/8] fix(docs): update screenshot example in Scrapybara migration guide --- migrations/scrapybara.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migrations/scrapybara.mdx b/migrations/scrapybara.mdx index 380e7fc..3d87e31 100644 --- a/migrations/scrapybara.mdx +++ b/migrations/scrapybara.mdx @@ -193,10 +193,10 @@ client.browsers.computer.type_text( delay=100 ) -# Take a screenshot -screenshot = client.browsers.computer.capture_screenshot( - id=kernel_browser.session_id -) +# Take a full screenshot +with open('screenshot.png', 'wb') as f: + image_data = client.browsers.computer.capture_screenshot(id=kernel_browser.session_id) + f.write(image_data.read()) ``` For a complete reference of all available Computer Controls methods in Kernel, see the [Computer Controls documentation](/browsers/computer-controls). From 086052d597c22bc1ffc7a25b6d04979ad38528c8 Mon Sep 17 00:00:00 2001 From: "tembo[bot]" <208362400+tembo-io[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:11:32 +0000 Subject: [PATCH 6/8] fix(docs): update Scrapybara API examples with correct syntax --- migrations/scrapybara.mdx | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/migrations/scrapybara.mdx b/migrations/scrapybara.mdx index 3d87e31..59e1416 100644 --- a/migrations/scrapybara.mdx +++ b/migrations/scrapybara.mdx @@ -15,9 +15,9 @@ title: "Scrapybara" | **Stealth Mode** | ❌ Not available | Create browser with `stealth: true` | | **Replays** | ❌ Not available | `client.browsers.replays.start()` and `client.browsers.replays.stop()` | | **Save Auth** | `instance.browser.save_auth(name="default")` | Create [Profile](/browsers/profiles). Then create browser with `kernel.browsers.create(profile={"name": "profile1", "save_changes": True})` | -| **Click** | `instance.browser.computer.click_mouse(x=100, y=200)` | `client.browsers.computer.click_mouse(id=session_id, x=100, y=200)` | -| **Drag** | `instance.browser.computer.drag_mouse(path=[(100,100), (200,200)])` | `client.browsers.computer.drag_mouse(id=session_id, path=[[100, 200], [150, 220], [200, 260]])` | -| **Screenshot** | `instance.screenshot()` or `instance.browser.computer.take_screenshot()` | `client.browsers.computer.capture_screenshot(id=session_id)` | +| **Click** | `instance.computer(action="click_mouse", button="left")` | `client.browsers.computer.click_mouse(id=session_id, x=100, y=200)` | +| **Drag** | `instance.computer(action="drag_mouse", path=[[100, 200], [300, 400]])` | `client.browsers.computer.drag_mouse(id=session_id, path=[[100, 200], [150, 220], [200, 260]])` | +| **Screenshot** | `instance.computer(action="take_screenshot").base64_image` | `client.browsers.computer.capture_screenshot(id=session_id)` | ## How to migrate @@ -150,18 +150,16 @@ Both Scrapybara and Kernel provide Computer Controls APIs that allow you to prog instance = client.start_browser() # Click at specific coordinates -instance.browser.computer.click_mouse(x=100, y=200) +instance.computer(action="click_mouse", button="left") # Drag from one position to another -instance.browser.computer.drag_mouse( - path=[(100, 100), (200, 200)] -) +instance.computer(action="drag_mouse", path=[[100, 200], [300, 400]]) # Type text -instance.browser.computer.type_text(text="Hello World") +instance.computer(action="type_text", text="Hello World") # Take a screenshot -screenshot = instance.browser.computer.take_screenshot() +screenshot = instance.computer(action="take_screenshot").base64_image ``` **Kernel** @@ -224,14 +222,14 @@ For a complete reference of all available Computer Controls methods in Kernel, s | **File Download** | Via browser, then `instance.file()` | `client.browsers.fs.read_file()` | | **Process Control** | `instance.bash()` | `client.browsers.process.*` | | **Proxy Support** | ❌ Not available | Create [Proxy](/proxies/overview#1-create-a-proxy). Then create browser with `client.browsers.create(proxy_id=proxy.id)` | -| **Click Mouse** | `instance.browser.computer.click_mouse(x=100, y=200)` | `client.browsers.computer.click_mouse(id=session_id, x=100, y=200)` | -| **Move Mouse** | `instance.browser.computer.move_mouse(x=100, y=200)` | `client.browsers.computer.move_mouse(id=session_id, x=100, y=200)` | -| **Drag Mouse** | `instance.browser.computer.drag_mouse(path=[(100,100), (200,200)])` | `client.browsers.computer.drag_mouse(id=session_id, path=[[100, 200], [150, 220], [200, 260]])` | -| **Scroll** | `instance.browser.computer.scroll(delta_x=0, delta_y=100)` | `client.browsers.computer.scroll(id=session_id, delta_x=0, delta_y=100)` | -| **Type Text** | `instance.browser.computer.type_text(text="Hello")` | `client.browsers.computer.type_text(id=session_id, text="Hello")` | -| **Press Key** | `instance.browser.computer.press_key(keys=["Ctrl", "t"])` | `client.browsers.computer.press_key(id=session_id, keys=["Ctrl+t"])` | -| **Take Screenshot** | `instance.browser.computer.take_screenshot()` | `client.browsers.computer.capture_screenshot(id=session_id)` | -| **Get Cursor Position** | `instance.browser.computer.get_cursor_position()` | Use `move_mouse` with tracking or CDP | +| **Click Mouse** | `instance.computer(action="click_mouse", button="left")` | `client.browsers.computer.click_mouse(id=session_id, x=100, y=200)` | +| **Move Mouse** | `instance.computer(action="move_mouse", coordinates=[100, 200])` | `client.browsers.computer.move_mouse(id=session_id, x=100, y=200)` | +| **Drag Mouse** | `instance.computer(action="drag_mouse", path=[[100, 200], [300, 400]])` | `client.browsers.computer.drag_mouse(id=session_id, path=[[100, 200], [150, 220], [200, 260]])` | +| **Scroll** | `instance.computer(action="scroll", delta_x=0, delta_y=100)` | `client.browsers.computer.scroll(id=session_id, delta_x=0, delta_y=100)` | +| **Type Text** | `instance.computer(action="type_text", text="Hello")` | `client.browsers.computer.type_text(id=session_id, text="Hello")` | +| **Press Key** | `instance.computer(action="press_key", keys=["ctrl", "c"])` | `client.browsers.computer.press_key(id=session_id, keys=["Ctrl+t"])` | +| **Take Screenshot** | `instance.computer(action="take_screenshot").base64_image` | `client.browsers.computer.capture_screenshot(id=session_id)` | +| **Get Cursor Position** | `instance.computer(action="get_cursor_position").output` | Use `move_mouse` with tracking | --- From 1095730860e0ebe3286d04b8bebd68c73adeac7e Mon Sep 17 00:00:00 2001 From: "tembo[bot]" <208362400+tembo-io[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 22:42:40 +0000 Subject: [PATCH 7/8] fix(docs): update click_mouse example with correct parameters --- migrations/scrapybara.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/scrapybara.mdx b/migrations/scrapybara.mdx index 59e1416..4e50471 100644 --- a/migrations/scrapybara.mdx +++ b/migrations/scrapybara.mdx @@ -150,7 +150,7 @@ Both Scrapybara and Kernel provide Computer Controls APIs that allow you to prog instance = client.start_browser() # Click at specific coordinates -instance.computer(action="click_mouse", button="left") +instance.computer(action="click_mouse", button="right", coordinates=[300, 400]) # Drag from one position to another instance.computer(action="drag_mouse", path=[[100, 200], [300, 400]]) From f67d59326db3897cc4255b048c2fffce96ff9945 Mon Sep 17 00:00:00 2001 From: "tembo[bot]" <208362400+tembo-io[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 22:56:57 +0000 Subject: [PATCH 8/8] fix(docs): update Scrapybara scroll example in migration guide --- migrations/scrapybara.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/scrapybara.mdx b/migrations/scrapybara.mdx index 4e50471..0114bb1 100644 --- a/migrations/scrapybara.mdx +++ b/migrations/scrapybara.mdx @@ -225,7 +225,7 @@ For a complete reference of all available Computer Controls methods in Kernel, s | **Click Mouse** | `instance.computer(action="click_mouse", button="left")` | `client.browsers.computer.click_mouse(id=session_id, x=100, y=200)` | | **Move Mouse** | `instance.computer(action="move_mouse", coordinates=[100, 200])` | `client.browsers.computer.move_mouse(id=session_id, x=100, y=200)` | | **Drag Mouse** | `instance.computer(action="drag_mouse", path=[[100, 200], [300, 400]])` | `client.browsers.computer.drag_mouse(id=session_id, path=[[100, 200], [150, 220], [200, 260]])` | -| **Scroll** | `instance.computer(action="scroll", delta_x=0, delta_y=100)` | `client.browsers.computer.scroll(id=session_id, delta_x=0, delta_y=100)` | +| **Scroll** | `instance.computer(action="scroll", coordinates=[100, 100], delta_x=0, delta_y=200)` | `client.browsers.computer.scroll(id=session_id, delta_x=0, delta_y=100)` | | **Type Text** | `instance.computer(action="type_text", text="Hello")` | `client.browsers.computer.type_text(id=session_id, text="Hello")` | | **Press Key** | `instance.computer(action="press_key", keys=["ctrl", "c"])` | `client.browsers.computer.press_key(id=session_id, keys=["Ctrl+t"])` | | **Take Screenshot** | `instance.computer(action="take_screenshot").base64_image` | `client.browsers.computer.capture_screenshot(id=session_id)` |