# -*- coding: utf-8 -*- import sys sys.path.insert(0, 'c:/Users/청춘약국/source/pharmacy-wholesale-api') from dotenv import load_dotenv load_dotenv('c:/Users/청춘약국/source/pharmacy-wholesale-api/.env') from wholesale import GeoYoungSession from bs4 import BeautifulSoup session = GeoYoungSession() session.login() # MyPage HTML 직접 확인 resp = session.session.get( f"{session.BASE_URL}/MyPage", params={'dtpFrom': '2026-03-06', 'dtpTo': '2026-03-06'}, timeout=30 ) soup = BeautifulSoup(resp.text, 'html.parser') table = soup.find('table') tbody = table.find('tbody') or table rows = tbody.find_all('tr') print("=== 베이슨 행 HTML 분석 ===\n") for row in rows: cells = row.find_all('td') if not cells or len(cells) < 10: continue name = cells[1].get_text(strip=True) if '베이슨' not in name: continue status = cells[9].get_text(strip=True) if len(cells) > 9 else '' print(f"제품명: {name}") print(f"상태: {status}") # 모든 버튼의 onclick 확인 print("버튼들:") for cell in cells: for btn in cell.find_all('button'): onclick = btn.get('onclick', '') btn_text = btn.get_text(strip=True) print(f" [{btn_text}] onclick: {onclick[:80]}...") print()