@@ -15,9 +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.browser. computer.click_mouse(x=100, y=200 ) ` | ` client.browsers.computer.click_mouse(id=session_id, x=100, y=200) ` |
19- | ** 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]]) ` |
20- | ** Screenshot** | ` instance.screenshot() ` or ` instance.browser. computer.take_screenshot() ` | ` client.browsers.computer.capture_screenshot(id=session_id) ` |
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) ` |
2121
2222## How to migrate
2323
@@ -150,18 +150,16 @@ Both Scrapybara and Kernel provide Computer Controls APIs that allow you to prog
150150instance = client.start_browser()
151151
152152# Click at specific coordinates
153- instance.browser. computer.click_mouse( x = 100 , y = 200 )
153+ instance.computer( action = " click_mouse " , button = " left " )
154154
155155# Drag from one position to another
156- instance.browser.computer.drag_mouse(
157- path = [(100 , 100 ), (200 , 200 )]
158- )
156+ instance.computer(action = " drag_mouse" , path = [[100 , 200 ], [300 , 400 ]])
159157
160158# Type text
161- instance.browser. computer.type_text( text = " Hello World" )
159+ instance.computer( action = " type_text " , text = " Hello World" )
162160
163161# Take a screenshot
164- screenshot = instance.browser. computer.take_screenshot()
162+ screenshot = instance.computer( action = " take_screenshot " ).base64_image
165163```
166164
167165** Kernel**
@@ -224,14 +222,14 @@ For a complete reference of all available Computer Controls methods in Kernel, s
224222| ** File Download** | Via browser, then ` instance.file() ` | ` client.browsers.fs.read_file() ` |
225223| ** Process Control** | ` instance.bash() ` | ` client.browsers.process.* ` |
226224| ** Proxy Support** | ❌ Not available | Create [ Proxy] ( /proxies/overview#1-create-a-proxy ) . Then create browser with ` client.browsers.create(proxy_id=proxy.id) ` |
227- | ** Click Mouse** | ` instance.browser. computer.click_mouse(x=100, y=200 ) ` | ` client.browsers.computer.click_mouse(id=session_id, x=100, y=200) ` |
228- | ** Move Mouse** | ` instance.browser. computer.move_mouse(x=100, y= 200) ` | ` client.browsers.computer.move_mouse(id=session_id, x=100, y=200) ` |
229- | ** 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]]) ` |
230- | ** Scroll** | ` instance.browser. computer.scroll( delta_x=0, delta_y=100) ` | ` client.browsers.computer.scroll(id=session_id, delta_x=0, delta_y=100) ` |
231- | ** Type Text** | ` instance.browser. computer.type_text( text="Hello") ` | ` client.browsers.computer.type_text(id=session_id, text="Hello") ` |
232- | ** Press Key** | ` instance.browser. computer.press_key( keys=["Ctrl ", "t "]) ` | ` client.browsers.computer.press_key(id=session_id, keys=["Ctrl+t"]) ` |
233- | ** Take Screenshot** | ` instance.browser. computer.take_screenshot() ` | ` client.browsers.computer.capture_screenshot(id=session_id) ` |
234- | ** Get Cursor Position** | ` instance.browser. computer.get_cursor_position() ` | Use ` move_mouse ` with tracking or CDP |
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", delta_x=0, delta_y=100) ` | ` 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 |
235233
236234---
237235
0 commit comments