feat: implement Facebook automation bot with comment and image attachment capabilities

This commit is contained in:
Victor Phan
2026-07-23 14:05:59 +07:00
parent 174a6761b4
commit e6b02867c3
3 changed files with 24 additions and 220 deletions
+8 -5
View File
@@ -149,8 +149,11 @@ class FacebookBot:
logging.info("Thoát ra màn hình chính (Homescreen)...")
self.d.press("home")
def dump_ui_for_debug(self, filename: str):
xml_dump = self.d.dump_hierarchy()
with open(filename, "w", encoding="utf-8") as f:
f.write(xml_dump)
logging.error(f"Đã lưu giao diện lỗi vào file {filename}")
def dump_ui_for_debug(self, filename="ui_dump.xml"):
import os
os.makedirs("xml_ui", exist_ok=True)
filepath = os.path.join("xml_ui", filename)
xml_content = self.d.dump_hierarchy()
with open(filepath, "w", encoding="utf-8") as f:
f.write(xml_content)
logging.info(f"Đã lưu cấu trúc UI hiện tại ra file {filepath} để debug.")