Skip to content

Commit 1c29aa5

Browse files
authored
Merge branch 'main' into mason/vercel-marketplace-docs
2 parents 256f00b + 3e1d7f5 commit 1c29aa5

File tree

4 files changed

+76
-1
lines changed

4 files changed

+76
-1
lines changed

apps/logs.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ logs = client.invocations.follow(invocation_id)
2525

2626
</CodeGroup>
2727

28+
<Info>Log lines will be truncated to 64KiB. For large payloads write data to external storage and log a reference instead.</Info>
29+
2830
## Via CLI
2931

3032
You can also stream the logs to your terminal via the CLI:

migrations/scrapybara.mdx

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Scrapybara"
33
---
44

5-
[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.
5+
[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.
66

77
## Key Concepts
88

@@ -15,6 +15,9 @@ title: "Scrapybara"
1515
| **Stealth Mode** | ❌ Not available | Create browser with `stealth: true` |
1616
| **Replays** | ❌ Not available | `client.browsers.replays.start()` and `client.browsers.replays.stop()` |
1717
| **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})` |
18+
| **Click** | `instance.computer(action="click_mouse", button="left")` | `client.browsers.computer.click_mouse(id=session_id, x=100, y=200)` |
19+
| **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]])` |
20+
| **Screenshot** | `instance.computer(action="take_screenshot").base64_image` | `client.browsers.computer.capture_screenshot(id=session_id)` |
1821

1922
## How to migrate
2023

@@ -138,6 +141,64 @@ browser2 = await client.browsers.create(
138141
)
139142
```
140143

144+
### Computer Controls
145+
146+
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.
147+
148+
**Scrapybara**
149+
```python
150+
instance = client.start_browser()
151+
152+
# Click at specific coordinates
153+
instance.computer(action="click_mouse", button="right", coordinates=[300, 400])
154+
155+
# Drag from one position to another
156+
instance.computer(action="drag_mouse", path=[[100, 200], [300, 400]])
157+
158+
# Type text
159+
instance.computer(action="type_text", text="Hello World")
160+
161+
# Take a screenshot
162+
screenshot = instance.computer(action="take_screenshot").base64_image
163+
```
164+
165+
**Kernel**
166+
```python
167+
kernel_browser = await client.browsers.create()
168+
169+
# Click at specific coordinates
170+
client.browsers.computer.click_mouse(
171+
id=kernel_browser.session_id,
172+
x=100,
173+
y=200
174+
)
175+
176+
# Drag from one position to another
177+
client.browsers.computer.drag_mouse(
178+
id=kernel_browser.session_id,
179+
path=[[100, 200], [150, 220], [200, 260]],
180+
button="left",
181+
delay=0,
182+
steps_per_segment=10,
183+
step_delay_ms=50,
184+
hold_keys=["Shift"]
185+
)
186+
187+
# Type text with optional delay
188+
client.browsers.computer.type_text(
189+
id=kernel_browser.session_id,
190+
text="Hello World",
191+
delay=100
192+
)
193+
194+
# Take a full screenshot
195+
with open('screenshot.png', 'wb') as f:
196+
image_data = client.browsers.computer.capture_screenshot(id=kernel_browser.session_id)
197+
f.write(image_data.read())
198+
```
199+
200+
For a complete reference of all available Computer Controls methods in Kernel, see the [Computer Controls documentation](/browsers/computer-controls).
201+
141202

142203
## Full API Comparison
143204

@@ -161,6 +222,14 @@ browser2 = await client.browsers.create(
161222
| **File Download** | Via browser, then `instance.file()` | `client.browsers.fs.read_file()` |
162223
| **Process Control** | `instance.bash()` | `client.browsers.process.*` |
163224
| **Proxy Support** | ❌ Not available | Create [Proxy](/proxies/overview#1-create-a-proxy). Then create browser with `client.browsers.create(proxy_id=proxy.id)` |
225+
| **Click Mouse** | `instance.computer(action="click_mouse", button="left")` | `client.browsers.computer.click_mouse(id=session_id, x=100, y=200)` |
226+
| **Move Mouse** | `instance.computer(action="move_mouse", coordinates=[100, 200])` | `client.browsers.computer.move_mouse(id=session_id, x=100, y=200)` |
227+
| **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]])` |
228+
| **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)` |
229+
| **Type Text** | `instance.computer(action="type_text", text="Hello")` | `client.browsers.computer.type_text(id=session_id, text="Hello")` |
230+
| **Press Key** | `instance.computer(action="press_key", keys=["ctrl", "c"])` | `client.browsers.computer.press_key(id=session_id, keys=["Ctrl+t"])` |
231+
| **Take Screenshot** | `instance.computer(action="take_screenshot").base64_image` | `client.browsers.computer.capture_screenshot(id=session_id)` |
232+
| **Get Cursor Position** | `instance.computer(action="get_cursor_position").output` | Use `move_mouse` with tracking |
164233

165234
---
166235

reference/cli/apps.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ Print the logs for the specified app.
4747
| `--follow`, `-f` | Follow logs in real-time (stream continuously). Optional. |
4848
| `--since <time>`, `-s` | How far back to retrieve logs (e.g., 5m, 1h). Defaults to 5m if not following, 5s if following. Optional. |
4949
| `--with-timestamps` | Include timestamps in each log line. Optional. |
50+
51+
<Info>Log lines will be truncated to 64KiB. For large payloads write data to external storage and log a reference instead.</Info>

reference/cli/browsers.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Stream browser logs.
4747
| `--by-persistent-id <id>` | Target browser by persistent ID. Optional. |
4848
| `--by-id <id>` | Target browser by session ID. Optional. |
4949

50+
<Info>Log lines will be truncated to 64KiB. For large payloads write data to external storage and log a reference instead.</Info>
51+
5052
## Replays
5153

5254
### `kernel browsers replays list`

0 commit comments

Comments
 (0)