z230
This commit is contained in:
@@ -7,7 +7,10 @@ BASE_URL = "https://janssen.4gclinical.com"
|
||||
EMAIL = "vbuzalka@its.jnj.com"
|
||||
PASSWORD = "Vlado123++-"
|
||||
|
||||
OUTPUT_DIR = "xls_ip_destruction"
|
||||
# STUDY = "42847922MDD3003"
|
||||
STUDY = "77242113UCO3001"
|
||||
|
||||
OUTPUT_DIR = f"xls_ip_destruction_{STUDY}"
|
||||
# ────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
||||
@@ -29,7 +32,7 @@ def download_ip_destruction():
|
||||
|
||||
# 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")
|
||||
|
||||
@@ -40,11 +43,17 @@ def download_ip_destruction():
|
||||
# Přečti dostupné košíky
|
||||
page.locator('input[placeholder="search"], input[type="text"]').first.click()
|
||||
page.wait_for_timeout(1000)
|
||||
baskets = [b.strip() for b in page.locator('mat-option').all_inner_texts()]
|
||||
baskets = [b.strip() for b in page.locator('mat-option').all_inner_texts()
|
||||
if b.strip() != "No results found"]
|
||||
print(f"Nalezeno {len(baskets)} košíků: {baskets}")
|
||||
page.keyboard.press("Escape")
|
||||
page.wait_for_timeout(500)
|
||||
|
||||
if not baskets:
|
||||
print("Žádné destruction košíky nenalezeny — přeskakuji.")
|
||||
browser.close()
|
||||
return
|
||||
|
||||
for basket in baskets:
|
||||
filename = os.path.join(OUTPUT_DIR, f"ip_destruction_basket_{basket}.xlsx")
|
||||
if os.path.exists(filename):
|
||||
|
||||
Reference in New Issue
Block a user