Update README.md

This commit is contained in:
Nicolas 2024-09-24 13:22:09 -04:00 committed by GitHub
parent 4194525640
commit 86744f6deb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -318,6 +318,34 @@ curl -X POST https://api.firecrawl.dev/v1/scrape \
}'
```
### Intracting with the page with Actions (Cloud-only)
Firecrawl allows you to perform various actions on a web page before scraping its content. This is particularly useful for interacting with dynamic content, navigating through pages, or accessing content that requires user interaction.
Here is an example of how to use actions to navigate to google.com, search for Firecrawl, click on the first result, and take a screenshot.
```bash
curl -X POST https://api.firecrawl.dev/v1/scrape \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"url": "google.com",
"formats": ["markdown"],
"actions": [
{"type": "wait", "milliseconds": 2000},
{"type": "click", "selector": "textarea[title=\"Search\"]"},
{"type": "wait", "milliseconds": 2000},
{"type": "write", "text": "firecrawl"},
{"type": "wait", "milliseconds": 2000},
{"type": "press", "key": "ENTER"},
{"type": "wait", "milliseconds": 3000},
{"type": "click", "selector": "h3"},
{"type": "wait", "milliseconds": 3000},
{"type": "screenshot"}
]
}'
```
### Search (v0) (Beta)