This commit is contained in:
2026-04-10 17:06:01 +02:00
parent bafd58d2b7
commit c4912744ea
29 changed files with 62 additions and 22 deletions
+31 -12
View File
@@ -7,16 +7,35 @@ BASE_URL = "https://janssen.4gclinical.com"
EMAIL = "vbuzalka@its.jnj.com"
PASSWORD = "Vlado123++-"
SITES = [
"S10-CZ10002",
"S10-CZ10004",
"S10-CZ10005",
"S10-CZ10008",
"S10-CZ10011",
"S10-CZ10012",
]
# STUDY = "42847922MDD3003"
STUDY = "77242113UCO3001"
OUTPUT_DIR = "xls_reports"
SITES = {
"42847922MDD3003": [
"S10-CZ10002",
"S10-CZ10004",
"S10-CZ10005",
"S10-CZ10008",
"S10-CZ10011",
"S10-CZ10012",
],
"77242113UCO3001": [
"DD5-CZ10001",
"DD5-CZ10003",
"DD5-CZ10006",
"DD5-CZ10009",
"DD5-CZ10010",
"DD5-CZ10012",
"DD5-CZ10013",
"DD5-CZ10015",
"DD5-CZ10016",
"DD5-CZ10020",
"DD5-CZ10021",
"DD5-CZ10022",
],
}
OUTPUT_DIR = f"xls_reports_{STUDY}"
# ────────────────────────────────────────────────────────────────────────────
os.makedirs(OUTPUT_DIR, exist_ok=True)
@@ -38,7 +57,7 @@ def download_reports():
# Výběr studie
page.get_by_label("Study *").click()
page.get_by_role("option", name="42847922MDD3003").click()
page.get_by_role("option", name=STUDY).click()
page.get_by_role("button", name="SELECT").click()
page.wait_for_load_state("networkidle")
@@ -46,7 +65,7 @@ def download_reports():
page.goto(f"{BASE_URL}/report/onsite_inventory_detail")
page.wait_for_load_state("networkidle", timeout=15000)
for site_id in SITES:
for site_id in SITES[STUDY]:
print(f"[{site_id}] Stahuji...")
# Otevři dropdown a vyber site
@@ -63,7 +82,7 @@ def download_reports():
download = dl.value
filename = os.path.join(OUTPUT_DIR, f"onsite_inventory_detail_{site_id}.xlsx")
download.save_as(filename)
print(f"[{site_id}] Uloženo {filename}")
print(f"[{site_id}] Ulozeno: {filename}")
# Zruš výběr site pro další iteraci
page.get_by_role("button", name="Clear").click()