|
| 1 | +--- |
| 2 | +title: "Scrapybara" |
| 3 | +--- |
| 4 | + |
| 5 | +Scrapybara is shutting down their cloud browser service on **October 15, 2025**. If you're currently using Scrapybara for browser automation, Kernel is here to help you migrate seamlessly. |
| 6 | + |
| 7 | +This guide shows you how to migrate your Scrapybara browser automation code to Kernel with minimal changes to your existing workflow. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## Browser API Comparison |
| 12 | + |
| 13 | +| Feature | Scrapybara | Kernel | |
| 14 | +|---------|-----------|--------| |
| 15 | +| **Create Browser** | `client.start_browser()` → `instance.browser.start()` | `client.browsers.create()` | |
| 16 | +| **Get CDP URL** | `instance.browser.get_cdp_url()` | Returns `cdp_ws_url` in create response | |
| 17 | +| **Get Live View** | `instance.get_stream_url()` | Returns `browser_live_view_url` in create response | |
| 18 | +| **Delete Browser** | `instance.browser.stop()` | `client.browsers.deleteByID(session_id)` | |
| 19 | +| **List Browsers** | `client.get_instances()` | `client.browsers.list()` | |
| 20 | +| **Save Auth State** | `instance.browser.save_auth(name)` | Create profile with `save_changes: true` | |
| 21 | +| **Load Auth State** | `instance.browser.authenticate(auth_state_id)` | `client.browsers.create({ profile: { name } })` | |
| 22 | +| **Pause/Resume** | `instance.pause()` / `instance.resume()` | Automatic standby mode (no manual control) | |
| 23 | +| **Screenshot** | `instance.screenshot()` | Use Playwright after CDP connection | |
| 24 | +| **Timeout Config** | `timeout_hours` parameter | `timeout_seconds` parameter | |
| 25 | +| **Stealth Mode** | ❌ Not available | `stealth: true` parameter | |
| 26 | +| **Headless Mode** | Not explicitly documented | `headless: true` parameter | |
| 27 | +| **Session Persistence** | Auth state only | Full state via `persistence: { id }` | |
| 28 | +| **Video Replays** | ❌ Not available | `client.browsers.replays.*` | |
| 29 | +| **File Upload** | `instance.upload()` | `client.browsers.fs.upload()` or Playwright | |
| 30 | +| **File Download** | Via browser, then `instance.file()` | `client.browsers.fs.readFile()` | |
| 31 | +| **Process Control** | `instance.bash()` | `client.browsers.process.*` | |
| 32 | +| **Proxy Support** | Not documented | `proxy_id` parameter + `client.proxies.*` | |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## Migration Examples |
| 37 | + |
| 38 | +### 1. Basic Browser Creation & CDP Connection |
| 39 | + |
| 40 | +#### Scrapybara |
| 41 | +```python |
| 42 | +from scrapybara import Scrapybara |
| 43 | +from playwright.async_api import async_playwright |
| 44 | + |
| 45 | +client = Scrapybara(api_key="your_api_key") |
| 46 | +instance = client.start_browser(timeout_hours=1) |
| 47 | +browser_session = instance.browser.start() |
| 48 | +cdp_url = browser_session.cdp_url |
| 49 | + |
| 50 | +async with async_playwright() as p: |
| 51 | + browser = await p.chromium.connect_over_cdp(cdp_url) |
| 52 | + page = browser.contexts[0].pages[0] |
| 53 | + await page.goto("https://example.com") |
| 54 | + await browser.close() |
| 55 | + |
| 56 | +instance.browser.stop() |
| 57 | +``` |
| 58 | + |
| 59 | +#### Kernel |
| 60 | +```python |
| 61 | +from kernel import Kernel |
| 62 | +from playwright.async_api import async_playwright |
| 63 | + |
| 64 | +client = Kernel(api_key="your_api_key") |
| 65 | +kernel_browser = client.browsers.create(timeout_seconds=3600) |
| 66 | +cdp_url = kernel_browser.cdp_ws_url |
| 67 | + |
| 68 | +async with async_playwright() as p: |
| 69 | + browser = await p.chromium.connect_over_cdp(cdp_url) |
| 70 | + page = browser.contexts[0].pages[0] |
| 71 | + await page.goto("https://example.com") |
| 72 | + await browser.close() |
| 73 | + |
| 74 | +await client.browsers.delete_by_id(kernel_browser.session_id) |
| 75 | +``` |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +### 2. Save & Reuse Authentication |
| 80 | + |
| 81 | +#### Scrapybara |
| 82 | +```python |
| 83 | +# First session - save auth |
| 84 | +instance = client.start_browser() |
| 85 | +instance.browser.start() |
| 86 | +# ... login to website via Playwright ... |
| 87 | +auth_state = instance.browser.save_auth(name="my-login") |
| 88 | +instance.stop() |
| 89 | + |
| 90 | +# Second session - load auth |
| 91 | +instance2 = client.start_browser() |
| 92 | +instance2.browser.start() |
| 93 | +instance2.browser.authenticate(auth_state.auth_state_id) |
| 94 | +# ... browser now has saved cookies ... |
| 95 | +``` |
| 96 | + |
| 97 | +#### Kernel |
| 98 | +```python |
| 99 | +# First session - save auth |
| 100 | +profile = await client.profiles.create(name="my-login") |
| 101 | +browser1 = await client.browsers.create( |
| 102 | + profile={"name": "my-login", "save_changes": True} |
| 103 | +) |
| 104 | +# ... login to website via Playwright ... |
| 105 | +await client.browsers.delete_by_id(browser1.session_id) |
| 106 | + |
| 107 | +# Second session - load auth |
| 108 | +browser2 = await client.browsers.create( |
| 109 | + profile={"name": "my-login"} |
| 110 | +) |
| 111 | +# ... browser now has saved cookies ... |
| 112 | +``` |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +### 3. Stealth Mode & Anti-Detection |
| 117 | + |
| 118 | +#### Scrapybara |
| 119 | +```python |
| 120 | +# No built-in stealth mode |
| 121 | +instance = client.start_browser() |
| 122 | +# Must handle anti-detection manually or use external tools |
| 123 | +``` |
| 124 | + |
| 125 | +#### Kernel |
| 126 | +```python |
| 127 | +# Built-in stealth mode with CAPTCHA solving |
| 128 | +browser = await client.browsers.create( |
| 129 | + stealth=True # Enables proxy + auto CAPTCHA solver |
| 130 | +) |
| 131 | +``` |
| 132 | + |
| 133 | +--- |
| 134 | + |
| 135 | +### 4. File Download |
| 136 | + |
| 137 | +#### Scrapybara |
| 138 | +```python |
| 139 | +instance = client.start_browser() |
| 140 | +# ... trigger download in browser ... |
| 141 | +# Then use file operations |
| 142 | +downloaded_file = instance.file(action="read", path="/download/path") |
| 143 | +``` |
| 144 | + |
| 145 | +#### Kernel |
| 146 | +```python |
| 147 | +browser = await client.browsers.create() |
| 148 | +# ... trigger download in browser via Playwright ... |
| 149 | +# Then read from filesystem |
| 150 | +file_response = await client.browsers.fs.read_file( |
| 151 | + browser.session_id, |
| 152 | + path="/tmp/downloads/file.pdf" |
| 153 | +) |
| 154 | +await file_response.write_to_file("local-file.pdf") |
| 155 | +``` |
| 156 | + |
| 157 | +--- |
| 158 | + |
| 159 | +### 5. Long-Running Sessions |
| 160 | + |
| 161 | +#### Scrapybara |
| 162 | +```python |
| 163 | +# Pause/resume for long-running sessions |
| 164 | +instance = client.start_browser(timeout_hours=24) |
| 165 | +# ... do some work ... |
| 166 | +instance.pause() # Pause to save costs |
| 167 | +# ... later ... |
| 168 | +instance.resume() # Resume work |
| 169 | +``` |
| 170 | + |
| 171 | +#### Kernel |
| 172 | +```python |
| 173 | +# Automatic standby mode + persistence |
| 174 | +browser = await client.browsers.create( |
| 175 | + persistence={"id": "my-long-session"}, |
| 176 | + timeout_seconds=86400 # 24 hours |
| 177 | +) |
| 178 | +# ... do some work ... |
| 179 | +await client.browsers.delete_by_id(browser.session_id) |
| 180 | + |
| 181 | +# Later - automatically restored with full state |
| 182 | +browser2 = await client.browsers.create( |
| 183 | + persistence={"id": "my-long-session"} |
| 184 | +) |
| 185 | +# Browser state fully restored (DOM, cookies, zoom, etc.) |
| 186 | +``` |
| 187 | + |
| 188 | +--- |
| 189 | + |
| 190 | +## Need Help? |
| 191 | + |
| 192 | +* **Documentation**: [docs.onkernel.com](https://www.onkernel.com/docs/introduction) |
| 193 | +* **Dashboard**: [dashboard.onkernel.com](https://dashboard.onkernel.com) |
| 194 | +* **Quick Templates**: `npx @onkernel/create-kernel-app` |
| 195 | + |
| 196 | +--- |
| 197 | + |
| 198 | +*Welcome to Kernel! We're excited to help you build crazy fast, reliable browser automations.* |
0 commit comments