Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

chore(MemoryStorage): always resolve to a new path when batchRemoveFiles is called (#1818)

Vlad Franguef83f4bd0d6c
diff --git a/packages/memory-storage/src/memory-storage.ts b/packages/memory-storage/src/memory-storage.ts
index c2de5c1d0..81a446635 100644
--- a/packages/memory-storage/src/memory-storage.ts
+++ b/packages/memory-storage/src/memory-storage.ts
@@ -240,7 +240,7 @@ export class MemoryStorage implements storage.StorageClient {
const folderExists = pathExistsSync(folder);
if (folderExists) {
- const temporaryFolder = folder.startsWith('__CRAWLEE_TEMPORARY_') ? folder : resolve(folder, `../__CRAWLEE_TEMPORARY_${counter}__`);
+ const temporaryFolder = resolve(folder, `../__CRAWLEE_TEMPORARY_${counter}__`);
try {
// Rename the old folder to the new one to allow background deletions