Skip to content

🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev

feat(cli): Adding the `-f` flag to `install` command

Karim shoairf8662bee29ad
diff --git a/scrapling/cli.py b/scrapling/cli.py
index be2c257..58ad43c 100644
--- a/scrapling/cli.py
+++ b/scrapling/cli.py
@@ -17,8 +17,9 @@ def run_command(command, line):
@click.command(help="Install all Scrapling's Fetchers dependencies")
-def install():
- if not get_package_dir().joinpath(".scrapling_dependencies_installed").exists():
[email protected]('-f', '--force', 'force', is_flag=True, default=False, type=bool, help="Force Scrapling to reinstall all Fetchers dependencies")
+def install(force):
+ if force or not get_package_dir().joinpath(".scrapling_dependencies_installed").exists():
run_command([sys.executable, "-m", "playwright", "install", 'chromium'], 'Playwright browsers')
run_command([sys.executable, "-m", "playwright", "install-deps", 'chromium', 'firefox'], 'Playwright dependencies')
run_command([sys.executable, "-m", "camoufox", "fetch", '--browserforge'], 'Camoufox browser and databases')