mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
Update example.ts
This commit is contained in:
parent
170a8ebfe5
commit
43f6c0a10f
|
@ -1,13 +1,13 @@
|
|||
import FirecrawlApp from './firecrawl/src/index' //'@mendable/firecrawl-js';
|
||||
import FirecrawlApp, { ScrapeResponse } from './firecrawl/src/index' //'@mendable/firecrawl-js';
|
||||
import { CrawlStatusResponse } from './firecrawl/src/index';
|
||||
|
||||
const app = new FirecrawlApp({apiKey: "fc-YOUR_API_KEY"});
|
||||
|
||||
// Scrape a website:
|
||||
const scrapeResult = await app.scrapeUrl('firecrawl.dev');
|
||||
const scrapeResult = await app.scrapeUrl('firecrawl.dev') as ScrapeResponse;
|
||||
|
||||
if (scrapeResult.data) {
|
||||
console.log(scrapeResult.data.markdown)
|
||||
if (scrapeResult) {
|
||||
console.log(scrapeResult.markdown)
|
||||
}
|
||||
|
||||
// Crawl a website:
|
||||
|
@ -30,5 +30,5 @@ if (job.data) {
|
|||
console.log(job.data[0].markdown);
|
||||
}
|
||||
|
||||
const mapResult = await app.map('https://firecrawl.dev');
|
||||
const mapResult = await app.mapUrl('https://firecrawl.dev');
|
||||
console.log(mapResult)
|
||||
|
|
Loading…
Reference in New Issue
Block a user