一括スクレイピング
一括スクレイピングは通常のスクレイピングと同様に動作しますが、単一のURLではなく、一度にスクレイピングするURLのリストを指定できます。
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);
})();
scrapeエンドポイントの詳細なリファレンスについては、 APIReferenceを確認してください。