This commit is contained in:
2025-09-21 21:35:39 +02:00
parent 422aae12ee
commit 4a7e1039a9
5 changed files with 553 additions and 6 deletions

View File

@@ -1,3 +1,6 @@
#Tento kod se pripoji do kartoteky Medevio, zmeni na 100 pacientu na stranu, nactene
# medevio_dump_patients_html_to_mysql.py
import time
import json
@@ -10,13 +13,13 @@ from mysql.connector import errorcode
from playwright.sync_api import sync_playwright, TimeoutError as PWTimeout
# ---------- CONFIG ----------
STATE_FILE = r"/medevio_storage.json"
STATE_FILE = r"medevio_storage.json"
BASE_LIST_URL = "https://my.medevio.cz/mudr-buzalkova/klinika/pacienti"
SAVE_DELAY_SECONDS = 10 # throttle: 10 sec per patient
# MySQL connection settings (fill in)
MYSQL_CFG = dict(
host="192.168.1.74",
host="192.168.1.76",
port=3307,
user="root",
password="Vlado9674+",
@@ -234,7 +237,7 @@ def main():
print(f"Already in DB: {len(already)} ids")
with sync_playwright() as p:
browser = p.chromium.launch(headless=True) # set False to watch
browser = p.chromium.launch(headless=False) # set False to watch
context = browser.new_context(storage_state=STATE_FILE)
# 1) Collect all IDs from the listing (all pages)