Debug Headless

This commit is contained in:
Yam ZhengLim
2024-01-27 18:28:09 +08:00
parent 1f86520c77
commit 5d19b5a567
+3 -3
View File
@@ -8,7 +8,7 @@ import pandas as pd
from datetime import datetime from datetime import datetime
def run(playwright: Playwright, DATA_PATH, ERROR_PATH, CONFIG) -> None: def run(playwright: Playwright, DATA_PATH, ERROR_PATH, CONFIG, is_headless) -> None:
try: try:
dt = datetime.now() dt = datetime.now()
date = dt.strftime('%Y-%m-%d') date = dt.strftime('%Y-%m-%d')
@@ -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, is_headless = False)
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, is_headless = True)