- kd_code 대신 internal_code로 장바구니 추가 - internal_code 없으면 검색 후 규격 매칭으로 찾기 - 백제 장바구니 담기 정상 작동 확인
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
# -*- 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()
|