Skip to content

Tool Python sử dụng Selenium để quản lý nhiều profile Google Chrome một cách dễ dàng và hiệu quả.

Notifications You must be signed in to change notification settings

f12your/GoogleProfile

Repository files navigation

Google Profile Manager

Tool Python sử dụng Selenium để quản lý nhiều profile Google Chrome một cách dễ dàng và hiệu quả.

🚀 Tính năng

  • ✅ Tạo và quản lý nhiều profile Chrome
  • ✅ Mở/đóng profiles độc lập
  • ✅ Chuyển đổi giữa các profiles
  • ✅ Chạy ở chế độ headless
  • ✅ Lưu trữ cấu hình profiles
  • ✅ Giao diện menu tương tác
  • ✅ Sử dụng ChromeDriver 114.0.5735.90 ổn định

📋 Yêu cầu hệ thống

  • Python 3.7+
  • Google Chrome browser
  • Windows/Linux/macOS

🛠️ Cài đặt

  1. Clone hoặc tải project:
git clone <repository-url>
cd google-profile-manager
  1. Cài đặt dependencies:
pip install -r requirements.txt
  1. Chạy tool:
python main.py

📖 Hướng dẫn sử dụng

Chế độ Menu tương tác

Chạy python main.py và chọn chế độ 1 để sử dụng menu tương tác:

🔧 GOOGLE PROFILE MANAGER
==================================================
1. Tạo profile mới
2. Mở profile
3. Đóng profile
4. Đóng tất cả profiles
5. Chuyển đổi profile
6. Xem danh sách profiles
7. Xem thông tin profile
8. Điều hướng đến Google
9. Xóa profile
0. Thoát
==================================================

Chế độ Demo nhanh

Chạy python main.py và chọn chế độ 2 để xem demo tự động.

Sử dụng trong code

from google_profile_manager import GoogleProfileManager

# Khởi tạo manager
manager = GoogleProfileManager()

# Tạo profile mới
manager.create_profile("my_profile")

# Mở profile
manager.open_profile("my_profile", headless=False)

# Chuyển đổi profile
driver = manager.switch_to_profile("my_profile")

# Thao tác với browser
driver.get("https://www.google.com")
driver.find_element("name", "q").send_keys("Hello World")

# Đóng profile
manager.close_profile("my_profile")

🔧 API Reference

GoogleProfileManager

Khởi tạo

manager = GoogleProfileManager(profiles_dir="chrome_profiles")

Các phương thức chính

Phương thức Mô tả Tham số Trả về
create_profile(name, user_data_dir) Tạo profile mới name: tên profile, user_data_dir: đường dẫn (tùy chọn) bool
open_profile(name, headless) Mở profile name: tên profile, headless: chế độ headless bool
close_profile(name) Đóng profile name: tên profile bool
close_all_profiles() Đóng tất cả profiles - bool
switch_to_profile(name) Chuyển đổi profile name: tên profile webdriver.Chrome
get_active_profiles() Lấy danh sách profiles đang mở - List[str]
get_all_profiles() Lấy tất cả profiles - List[str]
delete_profile(name) Xóa profile name: tên profile bool
get_profile_info(name) Lấy thông tin profile name: tên profile dict
navigate_to_google(name) Điều hướng đến Google name: tên profile bool

📁 Cấu trúc thư mục

google-profile-manager/
├── google_profile_manager.py  # Class chính
├── main.py                    # File demo và menu
├── requirements.txt           # Dependencies
├── README.md                 # Hướng dẫn
└── chrome_profiles/          # Thư mục chứa profiles
    ├── profiles_config.json  # File cấu hình
    ├── chromedriver_114/     # ChromeDriver 114
    ├── profile1/            # Profile 1
    ├── profile2/            # Profile 2
    └── ...

⚙️ Cấu hình

ChromeDriver 114.0.5735.90

Tool sử dụng ChromeDriver phiên bản 114.0.5735.90 ổn định:

  • Tương thích tốt với Chrome mới
  • Ít lỗi crash hơn phiên bản mới nhất
  • Tự động tải và cài đặt

Tùy chỉnh Chrome options

Bạn có thể chỉnh sửa Chrome options trong file google_profile_manager.py:

chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--disable-plugins")
chrome_options.add_argument("--disable-web-security")

Thay đổi thư mục profiles

manager = GoogleProfileManager(profiles_dir="my_custom_profiles")

🐛 Xử lý lỗi thường gặp

1. ChromeDriver không tìm thấy

❌ ChromeDriver 114 chưa được thiết lập!

Giải pháp: Tool tự động tải ChromeDriver 114, nếu vẫn lỗi thì kiểm tra kết nối internet.

2. Profile đã tồn tại

⚠️ Profile 'my_profile' đã được mở!

Giải pháp: Đóng profile hiện tại trước khi mở lại.

3. Quyền truy cập thư mục

❌ Lỗi khi tạo profile: Permission denied

Giải pháp: Chạy với quyền administrator hoặc chọn thư mục khác.

🔒 Bảo mật

  • Mỗi profile có thư mục riêng biệt
  • Dữ liệu profile được lưu trữ cục bộ
  • Không gửi dữ liệu lên server
  • Tự động đóng profiles khi thoát

📝 Ghi chú

  • Tool tự động tải ChromeDriver 114.0.5735.90
  • Mỗi profile có thể chạy độc lập với nhau
  • Hỗ trợ chế độ headless để chạy ngầm
  • Sử dụng ChromeDriver ổn định

🤝 Đóng góp

Mọi đóng góp đều được chào đón! Hãy tạo issue hoặc pull request.

📄 License

MIT License - Xem file LICENSE để biết thêm chi tiết.

👨‍💻 Tác giả

Tool được phát triển để hỗ trợ quản lý nhiều tài khoản Google một cách hiệu quả.


Lưu ý: Tool này chỉ dành cho mục đích học tập và phát triển. Vui lòng tuân thủ các điều khoản sử dụng của Google.

About

Tool Python sử dụng Selenium để quản lý nhiều profile Google Chrome một cách dễ dàng và hiệu quả.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published