From 86744f6deb1f2dc8ab0550e1eba2cf1c510c4e72 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 24 Sep 2024 13:22:09 -0400 Subject: [PATCH] Update README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 0011e0e..04927ac 100644 --- a/README.md +++ b/README.md @@ -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)