Fix the table not loading, also fix runner to install playwright

This commit is contained in:
2025-12-06 23:55:29 -08:00
parent 4b122182a4
commit 9a55021063
2 changed files with 112 additions and 101 deletions

View File

@@ -1,24 +1,48 @@
@echo off
setlocal
setlocal ENABLEDELAYEDEXPANSION
:: Set the project folder to this script's directory
:: Set project directory to script's location
set "PROJECT_DIR=%~dp0"
cd /d "%PROJECT_DIR%"
:: Check if venv folder exists; if not, create venv and install requirements
echo -----------------------------------------
echo Checking virtual environment...
echo -----------------------------------------
:: Create venv if missing
if not exist "venv\Scripts\python.exe" (
echo Creating virtual environment...
python -m venv venv
call venv\Scripts\activate.bat
echo Installing required packages...
pip install --upgrade pip
pip install flask selenium webdriver-manager beautifulsoup4
) else (
call venv\Scripts\activate.bat
)
:: Run the Flask server with logs redirected to server.log
echo Starting Flask server, logs will be written to server.log
:: Activate venv
call "venv\Scripts\activate.bat"
echo -----------------------------------------
echo Upgrading pip...
echo -----------------------------------------
python -m pip install --upgrade pip
echo -----------------------------------------
echo Installing Python prerequisites...
echo -----------------------------------------
pip install flask selenium webdriver-manager beautifulsoup4 playwright
echo -----------------------------------------
echo Installing Playwright browser binaries...
echo -----------------------------------------
playwright install || (
echo ERROR: Playwright install failed! Trying chromium only...
playwright install chromium
)
echo -----------------------------------------
echo All dependencies installed successfully!
echo Launching server...
echo -----------------------------------------
:: Start Flask server with persistent window
start "" cmd /k "venv\Scripts\python.exe scraper_service.py"
endlocal