diff --git a/serverPython/test_shopee.py b/serverPython/test_shopee.py index 5ccbf78..fa3ed90 100644 --- a/serverPython/test_shopee.py +++ b/serverPython/test_shopee.py @@ -5,9 +5,14 @@ import time d = u2.connect('10.160.138.2:5555') link = "https://vn.shp.ee/tZVnqovi" +print("Đang bật sáng màn hình...") +d.screen_on() +# d.unlock() # Bỏ comment dòng này nếu máy bạn có màn hình khóa vuốt (không mật khẩu) +time.sleep(1) + print("🚀 Đang bắn lệnh ép Shopee mở thẳng sản phẩm...") # Lệnh ADB này ép Android mở link trực tiếp bằng app Shopee -d.shell(f'am start -a android.intent.action.VIEW -d "{link}" com.shopee.vn') +d.shell(f'am start -a android.intent.action.VIEW -d "{link}"') # Chờ 8 giây để app load xong hình ảnh và thông tin (mạng chậm thì tăng lên) print("⏳ Đang đợi Shopee tải trang...") @@ -21,15 +26,3 @@ with open("ui_dump.xml", "w", encoding="utf-8") as f: f.write(xml_dump) print("✅ Đã xuất giao diện ra file 'ui_dump.xml'.") - -# THỬ TÌM NHANH TỰ ĐỘNG -# (Shopee thường để chữ "Hoa hồng" hoặc "%" ở một nút nào đó) -try: - commission_btn = d(textContains="Hoa hồng") - if commission_btn.exists: - print(f"🎉 TÌM THẤY: {commission_btn.get_text()}") - else: - print("⚠️ Không thấy chữ 'Hoa hồng' hiển thị ngay trên màn hình chính.") - print("👉 Vui lòng mở file 'ui_dump.xml' lên, tìm kiếm (Ctrl+F) dấu '%' để xem Shopee đang đặt tên biến hoa hồng là gì!") -except Exception as e: - print("Lỗi:", e)