Skip to content

Commit d0145f4

Browse files
feat: add --lockdown flag to scrape (#104)
* feat: add --lockdown-mode flag to scrape * rename --lockdown-mode to --lockdown
1 parent fefadc0 commit d0145f4

5 files changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ firecrawl scrape https://firecrawl.dev https://firecrawl.dev/blog https://docs.f
152152
| `--include-tags <tags>` | Only include specific HTML tags |
153153
| `--exclude-tags <tags>` | Exclude specific HTML tags |
154154
| `--max-age <milliseconds>` | Maximum age of cached content in milliseconds |
155+
| `--lockdown` | Enable lockdown mode for the scrape |
155156
| `-o, --output <path>` | Save output to file |
156157
| `--json` | Output as JSON format |
157158
| `--pretty` | Pretty print JSON output |

src/commands/scrape.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ export async function executeScrape(
118118
scrapeParams.profile = options.profile;
119119
}
120120

121+
if (options.lockdown) {
122+
scrapeParams.lockdown = true;
123+
}
124+
121125
// Execute scrape with timing - only wrap the scrape call in try-catch
122126
const requestStartTime = Date.now();
123127

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ function createScrapeCommand(): Command {
173173
'--no-save-changes',
174174
'Load existing profile data without saving changes (default: saves changes)'
175175
)
176+
.option('--lockdown', 'Enable lockdown mode for the scrape', false)
176177

177178
.action(async (positionalArgs, options) => {
178179
// Collect URLs from positional args and --url option
@@ -288,6 +289,7 @@ function createDownloadCommand(): Command {
288289
'--languages <codes>',
289290
'Comma-separated language codes for scraping (e.g., en,es)'
290291
)
292+
.option('--lockdown', 'Enable lockdown mode for the scrape', false)
291293
.option('-y, --yes', 'Skip confirmation prompt', false)
292294
.option(
293295
'-k, --api-key <key>',

src/types/scrape.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export interface ScrapeOptions {
6262
name: string;
6363
saveChanges?: boolean;
6464
};
65+
/** Enable lockdown mode for the scrape */
66+
lockdown?: boolean;
6567
}
6668

6769
export interface ScrapeResult {

src/utils/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,6 @@ export function parseScrapeOptions(options: any): ScrapeOptions {
121121
location,
122122
query: options.query,
123123
profile,
124+
lockdown: options.lockdown,
124125
};
125126
}

0 commit comments

Comments
 (0)