Hướng Dẫn Sử Dụng GoLogin Antidetect Browser Miễn Phí Vĩnh Viễn + Chạy Offline Kết Hợp Selenium Automation
GoLogin cho phép tạo và sử dụng profile antidetect hoàn toàn miễn phí mãi mãi (free forever), giúp bạn quản lý hàng trăm, hàng nghìn tài khoản mà không lo bị checkpoint, khóa tài khoản do phát hiện đa tài khoản.
Bài viết này sẽ hướng dẫn chi tiết cách chạy profile GoLogin ở chế độ offline (không cần mở giao diện GoLogin) và kết nối trực tiếp với Selenium để tự động hóa (automation) bằng Python hoặc C#.
Lưu ý quan trọng:
- Bạn cần có kiến thức lập trình cơ bản (Python hoặc C#).
- GoLogin phải đang chạy cục bộ (local) trên máy tính của bạn và bật API Local (mặc định đã bật).
2 Cách Khởi Động Profile Offline Với Selenium
Cách 1: Khởi động qua API Local (khuyến nghị – không cần biết đường dẫn folder profile)
GoLogin cung cấp Local API tại địa chỉ: http://127.0.0.1:35000 hoặc cổng bạn đã cấu hình.
Bạn chỉ cần truyền Profile ID là có thể khởi động profile mà không cần mở GoLogin.
Ví dụ Python (đơn giản và ổn định nhất):
import json
import requests
from selenium import webdriver
from time import sleep
# Thay YOUR_PROFILE_ID bằng ID profile của bạn (xem trong GoLogin)
profile_id = "YOUR_PROFILE_ID" # ví dụ: yL0n3t1c2d3e4f5g6h7i8j9k0
url = f"http://127.0.0.1:35000/browser/start?profile_id={profile_id}"
response = requests.get(url)
data = response.json()
if data["status"] == "success":
debugger_address = data["debuggerAddress"]
chromedriver_path = data["chromedriverPath"]
options = webdriver.ChromeOptions()
options.add_experimental_option("debuggerAddress", debugger_address)
driver = webdriver.Chrome(executable_path=chromedriver_path, options=options)
driver.get("https://iphey.com") # Kiểm tra fingerprint
sleep(5)
# ===> Viết code automation của bạn ở đây <===
driver.quit()
else:
print("Lỗi khởi động profile:", data)
Cách 2: Khởi động offline bằng đường dẫn folder profile (không cần API)
Phù hợp khi bạn muốn chạy nhiều profile cùng lúc mà không phụ thuộc vào API.
Python:
import json
import requests
from selenium import webdriver
from time import sleep
# Đường dẫn tới thư mục profile đã được export/tạo sẵn
# Ví dụ: C:\GoLogin\profiles\ten_profile_profileID
path = r"C:\GoLogin\profiles\ten_cua_ban_profileID"
# GoLogin phải đang chạy và bật Local API
server_url = f"http://localhost:36969/start?path={path}&version=130&os=win"
response = requests.get(server_url)
data = response.json()
if data.get("status") == "success":
debugger_address = data["debuggerAddress"]
chrome_driver_path = data["chromeDriverPath"]
options = webdriver.ChromeOptions()
options.add_experimental_option("debuggerAddress", debugger_address)
driver = webdriver.Chrome(executable_path=chrome_driver_path, options=options)
driver.get("https://iphey.com")
sleep(5)
# ===> Code automation của bạn ở đây <===
driver.quit()
else:
print("Lỗi:", data)
Đây là phiên bản C# sạch sẽ, hiện đại, đầy đủ xử lý lỗi và dễ bảo trì hơn (dùng .NET 6+ trở lên, HttpClient thay cho WebClient đã lỗi thời):
using System;
using System.IO;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
public class GoLoginAutomation
{
private static readonly HttpClient httpClient = new HttpClient();
public static async Task<IWebDriver> StartGoLoginProfileAsync(string profileId)
{
// Cách 1: Dùng API mới (khuyến nghị - GoLogin từ 2024 trở lên)
string url = $"http://127.0.0.1:35000/browser/start?profile_id={profileId}";
// Cách 2: Nếu vẫn dùng API cũ (cổng 36969 + đường dẫn folder)
// string folderPath = @"C:\GoLogin\profiles\ten_profile_profileID";
// string url = $"http://localhost:36969/start?path={folderPath}&version=130&os=win";
try
{
HttpResponseMessage response = await httpClient.GetAsync(url);
response.EnsureSuccessStatusCode();
string jsonResponse = await response.Content.ReadAsStringAsync();
using JsonDocument doc = JsonDocument.Parse(jsonResponse);
JsonElement root = doc.RootElement;
if (root.GetProperty("status").GetString() != "success")
{
throw new Exception($"GoLogin trả về lỗi: {root.GetProperty("message").GetString()}");
}
string debuggerAddress = root.GetProperty("debuggerAddress").GetString();
string chromedriverPath = root.GetProperty("chromedriverPath").GetString(); // hoặc "chromeDriverPath" ở phiên bản cũ
var service = ChromeDriverService.CreateDefaultService(Directory.GetCurrentDirectory(), Path.GetFileName(chromedriverPath));
service.HideCommandPromptWindow = true;
var options = new ChromeOptions();
options.DebuggerAddress = debuggerAddress;
IWebDriver driver = new ChromeDriver(service, options, TimeSpan.FromMinutes(3));
return driver;
}
catch (Exception ex)
{
Console.WriteLine($"Lỗi khởi động profile GoLogin: {ex.Message}");
throw;
}
}
public static async Task Main(string[] args)
{
string profileId = "YOUR_PROFILE_ID_HERE"; // Thay bằng ID profile của bạn
IWebDriver driver = null;
try
{
driver = await StartGoLoginProfileAsync(profileId);
driver.Navigate().GoToUrl("https://iphey.com");
Console.WriteLine("Đã mở profile - Fingerprint: " + driver.Url);
// ===> VIẾT CODE AUTOMATION CỦA BẠN Ở ĐÂY <===
await Task.Delay(5000); // Ví dụ chờ 5 giây
}
catch (Exception ex)
{
Console.WriteLine("Lỗi: " + ex.Message);
}
finally
{
driver?.Quit(); // Luôn đóng sạch Chrome + Chromedriver
}
}
}
Ví dụ C# (.NET)
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using Newtonsoft.Json;
using System.Net;
string profileId = "YOUR_PROFILE_ID";
using (var client = new WebClient())
{
string url = $"http://127.0.0.1:35000/browser/start?profile_id={profileId}";
string jsonResponse = client.DownloadString(url);
dynamic data = JsonConvert.DeserializeObject(jsonResponse);
if (data.status == "success")
{
string debuggerAddress = data.debuggerAddress;
string driverPath = data.chromedriverPath;
var service = ChromeDriverService.CreateDefaultService(System.IO.Directory.GetCurrentDirectory(), driverPath);
service.HideCommandPromptWindow = true;
var options = new ChromeOptions();
options.DebuggerAddress = debuggerAddress;
IWebDriver driver = new ChromeDriver(service, options);
driver.Navigate().GoToUrl("https://iphey.com");
System.Threading.Thread.Sleep(5000);
// Viết code automation ở đây
driver.Quit();
}
}
Mẹo Hay & Lưu Ý Quan Trọng
- GoLogin miễn phí vĩnh viễn cho phép tạo hàng nghìn profile mà không mất phí.
- Luôn kiểm tra fingerprint tại https://tricksmmo.com hoặc https://whoer.net sau khi kết nối.
- Không cần đăng nhập tài khoản GoLogin khi dùng offline (chỉ cần chạy ứng dụng GoLogin nền).
- Nếu gặp lỗi “Connection refused” → kiểm tra GoLogin có đang chạy không và cổng API (mặc định 35000 hoặc 36969).
Chúc các bạn nuôi tài khoản thành công và kiếm được thật nhiều tiền!
Nếu cần hỗ trợ thêm hoặc script mẫu nâng cao (multithreading, proxy tự động, giải captcha…), inbox mình tại @ToolsKiemTrieuDo (Telegram).
Leave a Reply
You must be logged in to post a comment.