Fix the table not loading, also fix runner to install playwright
This commit is contained in:
46
runner.bat
46
runner.bat
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user