Вот как выглядит мой Firecrawl только с HTML и разметкой:
import Firecrawl from '@mendable/firecrawl-js';
import 'dotenv/config'; // load .env
async function captureAndGenerate(url) {
const firecrawl = new Firecrawl({ apiKey: process.env.FIRECRAWL_API_KEY });
// 1. Scrape the page
const scraped = await firecrawl.scrape(url, { formats: ['html', 'markdown'] });
// Check if data exists
if (!scraped || !scraped.data) {
throw new Error('Firecrawl did not return data. Full response: ' + JSON.stringify(scraped));
}
const html = scraped.data.html;
const markdown = scraped.data.markdown;
console.log("
}
captureAndGenerate("https://example.com").catch(console.error);
Подробнее здесь: https://stackoverflow.com/questions/797 ... stead-of-u
Мобильная версия