Contact Us
If you still have questions or prefer to get help directly from an agent, please submit a request.
Popular topics: Multilogin X, Multilogin 6, Subscription & payments,
-
Will Multilogin X work on your device? Check our system requirements How to buy a Multilogin X subscription How to sync Multilogin 6 subscription with Multilogin X How to transfer profiles to Multilogin X from other apps How to navigate Multilogin X interface Multilogin X made easy: your 3-step guide to getting started How to connect the agent in Multilogin X How to create and launch a profile in Multilogin X How to warm up a profile in Multilogin X Stay undetected: 4 key steps to safe multiaccounting with Multilogin X Multilogin X support & resources: how to get help fast Getting started with Multilogin X FAQHow to choose the right proxy type Proxies & IP masking FAQ How to test a proxy What you need to know about Multilogin proxy: FAQ How to use Multilogin proxy: guide How to use HTTP and SOCKS proxies in Multilogin How to use Multilogin with 4G/5G connection How to set up Multilogin with NodeMaven How to use custom DNS in Multilogin How to fix profile launch or proxy connection issues How to fix “Profile failed to start” error How to fix “Wrong proxy data” error How to fix “ERR_TIMED_OUT” error How to fix “ERR_CONNECTION_RESET” error How to fix “ERR_CONNECTION_CLOSED” errorRetrieving the token Using the automation token in a workspace Retrieving profile, folder, and workspace IDs Retrieving the user ID Selenium automation example Playwright automation example Puppeteer automation example Logging in to Multilogin automatically Auto-launching the agent Exporting proxy details from profiles Converting external proxy lists into API-ready JSON files How to use Multilogin CLI tool How to launch CookieRobot using Script Runner How to export cookies using API Multilogin X automation FAQ API basics: key terms & concepts Script to create pre-configured profile templatesHow to send logs to support How to disconnect and reconnect the agent How to reinstall app components How to fix agent connection issues How to fix startup issues in Multilogin How to fix Multilogin issues on macOS How to unlock a locked profile How to fix profile launch or proxy connection issues How to fix missing browser data issue How to fix browser fingerprint inconsistencies Account banned: what should I do? How to fix Mimic launch issues on Linux How to enable web camera in Multilogin profiles My app or profile is slow: how to fix performance issues How to find missing profiles How to fix website loading issues in Multilogin How to access restricted websites How to fix connection issues in restricted regions How to fix "Your Windows system cannot perform the necessary WinAPI calls to launch Stealthfox browser" error How to fix small Stealthfox window resolution on Windows How to fix “The installation failed” macOS error How to fix “Failed to get profile data” error How to fix “Access denied” error How to fix "Restricted by plan" error How to fix “Some settings were reset” error How to fix “Profile failed to start” error How to fix “Plan limits reached” error How to fix “Wrong proxy data” error How to fix “Aw, Snap! STATUS_BREAKPOINT” error How to fix “Aw, Snap! STATUS_ACCESS_VIOLATION” error How to fix “ERR_TIMED_OUT” error How to fix “ERR_CONNECTION_RESET” error How to fix “ERR_CONNECTION_CLOSED” error Why isn't cookie import working? Why don’t cookies log you in to the target account?
-
How to send logs to support How to edit the app.properties file How to reinstall app components How to reinstall Multilogin 6 How to fix profile launch issues in Multilogin 6 How to fix proxy connection issues in Multilogin 6 How to fix frozen "Update in progress... Loading [3] of 2 components" status How to fix Android profile issues in Multilogin 6 How to fix issues with extension data in Mimic How to fix "Your Windows system cannot perform the necessary WinAPI calls to launch Stealthfox browser" error How to fix a profile stuck on “Active” status How to fix IP leaks when using a proxy How to fix "JavaScript error" in Multilogin 6 dark mode How to fix "Javax.crypto […] pad block corrupted" error How to fix "Fingerprint composition failed" error How to fix "Mimic/Stealthfox executable is not found" error How to fix “Profile is not created/updated” error How to fix "Downloading Mimic browser" error How to fix “Application request limit is reached” error How to fix "Invalid buffer arguments" error How to fix “Unable to save profile: User-Agent is empty” error How to fix "Cannot invite existing user" error Why isn't cookie import working? Why don’t cookies log you in to the target account?
-
How to choose the perfect Multilogin plan How to buy a Multilogin X subscription How to change a subscription How to renew a subscription How to cancel a subscription How to change a payment method How to manage invoices How to pay with crypto Subscription & payments FAQ How to sync Multilogin 6 subscription with Multilogin X
Selenium automation example

Written by Jason Nguyen
Updated on December 12th, 2024
Table of contents
This simple automation script in Python uses the Selenium library to manipulate a profile in Multilogin X. It performs the following actions:
- Sign in using Multilogin X API
- Start the profile defining Selenium as the selected automation type
- Retrieve the port used by the running profile
- Start a Selenium driver on localhost using the retrieved port
- Use the driver to manipulate browser actions
- Stop the profile in 5 seconds
Before you start
- Install the following Python libraries:
- requests
- selenium
- Insert your values into the below variables in the script:
Running the script
- Make sure the agent is connected, as it makes profile launching possible
- By default, the script below works for Mimic. To use it for Stealthfox, replace
options=ChromiumOptions()
withoptions=Options()
in the following line:driver = webdriver.Remote(command_executor=f'{LOCALHOST}:{selenium_port}', options=ChromiumOptions())
- Run the
.py
file with your automation code
Script example
import requests
import hashlib
import time
from selenium import webdriver
from selenium.webdriver.chromium.options import ChromiumOptions
from selenium.webdriver.firefox.options import Options
MLX_BASE = "https://api.multilogin.com"
MLX_LAUNCHER = "https://launcher.mlx.yt:45001/api/v1"
MLX_LAUNCHER_V2 = (
"https://launcher.mlx.yt:45001/api/v2" # recommended for launching profiles
)
LOCALHOST = "http://127.0.0.1"
HEADERS = {"Accept": "application/json", "Content-Type": "application/json"}
# TODO: Insert your account information in both variables below
USERNAME = ""
PASSWORD = ""
# TODO: Insert the Folder ID and the Profile ID below
FOLDER_ID = ""
PROFILE_ID = ""
def signin() -> str:
payload = {
"email": USERNAME,
"password": hashlib.md5(PASSWORD.encode()).hexdigest(),
}
r = requests.post(f"{MLX_BASE}/user/signin", json=payload)
if r.status_code != 200:
print(f"\nError during login: {r.text}\n")
else:
response = r.json()["data"]
token = response["token"]
return token
def start_profile() -> webdriver:
r = requests.get(
f"{MLX_LAUNCHER_V2}/profile/f/{FOLDER_ID}/p/{PROFILE_ID}/start?automation_type=selenium",
headers=HEADERS,
)
response = r.json()
if r.status_code != 200:
print(f"\nError while starting profile: {r.text}\n")
else:
print(f"\nProfile {PROFILE_ID} started.\n")
selenium_port = response["data"]["port"]
driver = webdriver.Remote(
command_executor=f"{LOCALHOST}:{selenium_port}", options=ChromiumOptions()
)
# For Stealthfox profiles use: options=Options()
# For Mimic profiles use: options=ChromiumOptions()
return driver
def stop_profile() -> None:
r = requests.get(f"{MLX_LAUNCHER}/profile/stop/p/{PROFILE_ID}", headers=HEADERS)
if r.status_code != 200:
print(f"\nError while stopping profile: {r.text}\n")
else:
print(f"\nProfile {PROFILE_ID} stopped.\n")
token = signin()
HEADERS.update({"Authorization": f"Bearer {token}"})
driver = start_profile()
driver.get("https://multilogin.com/")
time.sleep(5)
stop_profile()