Spaces:
No application file
No application file
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,70 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: AIBrowserAPI
|
| 3 |
-
emoji: 📉
|
| 4 |
-
colorFrom: yellow
|
| 5 |
-
colorTo: green
|
| 6 |
-
---
|
| 7 |
-
|
| 8 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
# README.md header for Hugging Face Spaces
|
| 12 |
-
---
|
| 13 |
-
title: Browser Automation API
|
| 14 |
-
emoji: 🌐
|
| 15 |
-
colorFrom: blue
|
| 16 |
-
colorTo: purple
|
| 17 |
-
sdk: docker
|
| 18 |
-
pinned: false
|
| 19 |
-
license: mit
|
| 20 |
-
---
|
| 21 |
-
|
| 22 |
-
# Browser Automation API
|
| 23 |
-
|
| 24 |
-
A browser automation API server that provides REST endpoints for controlling web browsers programmatically. Similar to browser-use but hosted as a service.
|
| 25 |
-
|
| 26 |
-
## Features
|
| 27 |
-
|
| 28 |
-
- Create and manage browser sessions
|
| 29 |
-
- Navigate to websites
|
| 30 |
-
- Click elements
|
| 31 |
-
- Type text into forms
|
| 32 |
-
- Take screenshots
|
| 33 |
-
- Execute JavaScript
|
| 34 |
-
- Get page information
|
| 35 |
-
|
| 36 |
-
## API Endpoints
|
| 37 |
-
|
| 38 |
-
- `POST /session/create` - Create a new browser session
|
| 39 |
-
- `DELETE /session/{session_id}` - Close a browser session
|
| 40 |
-
- `POST /session/{session_id}/navigate` - Navigate to a URL
|
| 41 |
-
- `POST /session/{session_id}/click` - Click an element
|
| 42 |
-
- `POST /session/{session_id}/type` - Type text into an element
|
| 43 |
-
- `GET /session/{session_id}/screenshot` - Take a screenshot
|
| 44 |
-
- `GET /session/{session_id}/page-info` - Get page information
|
| 45 |
-
- `GET /session/{session_id}/execute-js` - Execute JavaScript
|
| 46 |
-
|
| 47 |
-
## Usage
|
| 48 |
-
|
| 49 |
-
1. Create a session: `POST /session/create`
|
| 50 |
-
2. Navigate to a page: `POST /session/{session_id}/navigate`
|
| 51 |
-
3. Interact with elements using CSS selectors, XPath, etc.
|
| 52 |
-
4. Take screenshots or get page info as needed
|
| 53 |
-
5. Close the session when done
|
| 54 |
-
|
| 55 |
-
## Example
|
| 56 |
-
|
| 57 |
-
```python
|
| 58 |
-
import requests
|
| 59 |
-
|
| 60 |
-
# Create session
|
| 61 |
-
response = requests.post("https://your-space-url/session/create")
|
| 62 |
-
session_id = response.json()["session_id"]
|
| 63 |
-
|
| 64 |
-
# Navigate
|
| 65 |
-
requests.post(f"https://your-space-url/session/{session_id}/navigate",
|
| 66 |
-
json={"url": "https://example.com"})
|
| 67 |
-
|
| 68 |
-
# Take screenshot
|
| 69 |
-
screenshot = requests.get(f"https://your-space-url/session/{session_id}/screenshot")
|
| 70 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|