Batch Scrape
Batch Scrape hoạt động giống như scrape thông thường, ngoại trừ việc thay vì một URL duy nhất, bạn có thể cung cấp một danh sách URL để scrape cùng một lúc.
import { ScrapingCrawl } from "@scrapeless-ai/sdk";
// Initialize the client
const client = new ScrapingCrawl({
apiKey: "your-api-key", // Get your API key from https://scrapeless.com
});
(async () => {
const result = await client.batchScrapeUrls(
["https://example.com", "https://scrapeless.com"],
{
formats: ["markdown", "html", "links"],
onlyMainContent: false,
timeout: 15000,
browserOptions: {
proxyCountry: "ANY",
sessionName: "Crawl",
sessionRecording: true,
sessionTTL: 900,
},
}
);
console.log(result);
})();
Để xem tài liệu tham khảo đầy đủ về endpoint scrape, hãy xem API Reference.