Utilisez Interact pour contrôler une session de navigateur en direct : cliquez sur des boutons, remplissez des formulaires et extrayez du contenu dynamique.
app.post("/interact", async (c) => { const { url } = await c.req.json(); const result = await firecrawl.scrape(url, { formats: ['markdown'] }); const scrapeId = result.metadata?.scrapeId; await firecrawl.interact(scrapeId, { prompt: 'Search for iPhone 16 Pro Max' }); const response = await firecrawl.interact(scrapeId, { prompt: 'Click on the first result and tell me the price' }); await firecrawl.stopInteraction(scrapeId); return c.json({ output: response.output });});