Debug Headless

This commit is contained in:
Yam ZhengLim
2024-01-27 18:19:32 +08:00
parent 4ff602f2c6
commit da5162952f
2 changed files with 9 additions and 3 deletions
+7 -1
View File
@@ -16,6 +16,12 @@
###### python3 main.py ###### python3 main.py
``` ```
### First time run playwright
```
###### playwright install
###### playwright install-deps
```
### Some VM Tips ### Some VM Tips
``` ```
###### Host: data-managmenet project ###### Host: data-managmenet project
@@ -28,7 +34,7 @@
###### Crontab log: grep CRON /var/log/syslog ###### Crontab log: grep CRON /var/log/syslog
###### Python log: grep 'mycmd' /var/log/syslog ###### Python log: grep 'mycmd' /var/log/syslog
###### Remove file cmd: rm -rf ###### Remove file cmd: rm -rf
###### git clone https://gitlab.com/CIEFWorldwideSdnBhd/data-management.git ###### git clone https://gitlab.com/cief-data/data-management.git
###### pip3 install -r requirements.txt ###### pip3 install -r requirements.txt
``` ```
+2 -2
View File
@@ -136,7 +136,7 @@ if __name__ == '__main__':
os.makedirs(DATA_PATH, exist_ok=True) os.makedirs(DATA_PATH, exist_ok=True)
with sync_playwright() as playwright: with sync_playwright() as playwright:
run(playwright, DATA_PATH, ERROR_PATH, CONFIG) run(playwright, DATA_PATH, ERROR_PATH, CONFIG, HEADLESS_CONFIG = True)
else: else:
def run_app(C2M_FILES_TEMP_STORAGE_PATH, C2M_CONFIG): def run_app(C2M_FILES_TEMP_STORAGE_PATH, C2M_CONFIG):
@@ -149,4 +149,4 @@ else:
os.makedirs(DATA_PATH, exist_ok=True) os.makedirs(DATA_PATH, exist_ok=True)
with sync_playwright() as playwright: with sync_playwright() as playwright:
run(playwright, DATA_PATH, ERROR_PATH, C2M_CONFIG) run(playwright, DATA_PATH, ERROR_PATH, C2M_CONFIG, HEADLESS_CONFIG = False)