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 work on your device? Check our system requirements Mastering Multilogin X: a beginner’s handbook Multilogin X support & resources: how to get help fast How to buy a Multilogin X subscription How to navigate Multilogin X interface Multilogin X made easy: your 3-step guide to getting started How to sync Multilogin 6 subscription with Multilogin X How to transfer profiles to Multilogin X from other apps How to connect the agent in Multilogin X How to create and launch your first profile in Multilogin X Stay undetected: 4 key steps to safe multiaccounting with Multilogin X How to warm up a profile in Multilogin X Getting started with Multilogin X FAQHow agent and launcher work together in Multilogin X How to connect the agent in Multilogin X How to auto-launch the agent How to check and update the agent version in Multilogin X How to disconnect and reconnect the agent in Multilogin X How to uninstall the agent in Multilogin X How to manage agent logs in Multilogin XHow to use bulk actions in Multilogin X How to use a trash bin in Multilogin X How to create and launch your first profile in Multilogin X How to launch and stop profiles in Multilogin X How to install browser extensions in Multilogin X How to export and import profiles in Multilogin X How to use Quick profiles in Multilogin X How to use Android profiles in Multilogin X Profile management FAQMastering multi-accounting: the right way to use cookies How to use Cookie import in Multilogin X How to use Cookie export in Multilogin X How to use Pre-made cookies in Multilogin X How to launch CookieRobot using Script Runner Why don’t cookies log you in to the target account? Why isn't cookie import working? How to run CookieRobot in Multilogin CLIHow to choose the right proxy type 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 X 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” error How to fix IP leaks when using a proxy Proxies & IP masking FAQHow to adjust location settings in Multilogin X How to adjust software settings in Multilogin X How to adjust hardware settings in Multilogin X How to adjust screen resolutions in Multilogin Think before you switch: the truth about fingerprint mismatches Passive OS fingerprint masking (TCP/IP fingerprint) in Multilogin Should my font hash change in Multilogin? How to fix browser fingerprint inconsistencies How to replace Mimic icon in Multilogin on Windows Fingerprinting myths: what websites actually trackHow to fix "Your Windows system cannot perform the necessary WinAPI calls to launch Stealthfox browser" error How to fix “Failed to get profile data” error How to fix “Access denied” error How to fix “Aw, Snap! STATUS_BREAKPOINT” error How to fix “Aw, Snap! STATUS_ACCESS_VIOLATION” error How to fix “ERR_CONNECTION_CLOSED” error How to fix “ERR_TIMED_OUT” error How to fix “ERR_CONNECTION_RESET” 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 "Restricted by plan" error How to fix "Too many requests" errorBrowser core update is stuck? Try these solutions My app or profile is slow: how to fix performance issues Account banned: what should I do? Why isn't cookie import working? Why don’t cookies log you in to the target account? How to enable web camera in Multilogin profiles How to unlock a locked profile How to find missing profiles How to fix missing browser data issue How to fix startup issues in Multilogin How to fix Multilogin issues on macOS How to fix agent connection issues How to fix profile launch or proxy connection issues How to fix connection issues in restricted regions How to fix website loading issues in Multilogin How to fix Mimic launch issues on Linux How to fix browser fingerprint inconsistencies How to fix small Stealthfox window resolution on Windows How to fix IP leaks when using a proxyRetrieving the token Using the automation token in a workspace Logging in to Multilogin automatically Exporting proxy details from profiles Converting external proxy lists into API-ready JSON files How to launch CookieRobot using Script Runner Script to create pre-configured profile templates How to auto-launch the agent
-
Mastering Multilogin 6: a beginner’s handbook How to install Multilogin 6 on Linux How to transfer profiles between Multilogin 6 accounts How to set up default profile settings in Multilogin 6 How to customize a profile in Multilogin 6 How to use Quick edit sidebar in Multilogin 6 How to use Android profiles in Multilogin 6 How to install browser extensions in Multilogin 6 How to use CookieRobot in Multilogin 6 How to use Human typing emulation in MultiloginHow 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 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 don’t cookies log you in to the target account? Why isn't cookie import working?
-
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 How to sync Multilogin 6 subscription with Multilogin X Subscription & payments FAQ
- Home
- Multilogin X
- Automating tasks with API
- Puppeteer, selenium, and playwright
- Playwright automation example
Playwright automation example

Written by Villa Wu
Updated on March 18th, 2025
Table of contents
Playwright is an open-source automation library designed for testing web applications and automating interactions with web browsers. It offers comprehensive control over browser actions, including navigation, form filling, element clicking, and data extraction from web pages.
In this article, we will provide a simple script that launches a browser profile and connects it with Playwright.
You can automate Mimic browser profiles using Playwright for your web-scrapers. Note that Playwright for Stealthfox is not available in Multilogin X yet.
Before you start
JavaScript
- Download Node.js from the official website and install it
- Ensure Node.js and npm (Node Package Manager) are installed correctly:
node -v
npm -v
- Create a project directory, then run this command to initialize a new Node.js project and create a
package.json
file:
npm init -y
- Install Playwright as a dependency for your project:
npm install playwright
- Install Axios and MD5 library:
npm install axios
npm install md5
Python
- Install the following Python libraries:
- requests
- playwright
- Install the necessary browser binaries:
playwright install
Running the script
JavaScript
- Make sure the agent is connected, as it makes profile launching possible
- Make sure Playwright is compatible with the current Mimic core version – check the release notes for Playwright and Mimic
- Run the
.js
file with your automation code
Script example
const { chromium } = require('playwright');
const md5 = require ('md5');
const axios = require('axios');
const HEADERS = {
"Content-Type": "application/json",
"Accept": "application/json",
};
const acc_info = {
// Insert your account information in both variables below
"email": "",
"password": md5("")
};
async function get_token() {
const signIn_URL = "https://api.multilogin.com/user/signin";
try {
const response = await axios.post(signIn_URL, acc_info, { headers: HEADERS });
return response.data.data.token;
} catch (error) {
console.log(error.message);
console.log("Response data:", error.response.data);
return false;
}
};
// Insert the Folder ID and the Profile ID below
const folder_id = "";
const profile_id = "";
async function start_browserProfile(){
const token = await get_token();
if (!token) return;
// Update HEADERS with bearer token retrived from the get_token function
HEADERS.Authorization = 'Bearer ' + token;
// Launch a profile defining "Playwright" as automation type
const profileLaunch_URL = `https://launcher.mlx.yt:45001/api/v2/profile/f/${folder_id}/p/${profile_id}/start?automation_type=playwright&headless_mode=false`;
try {
const response = await axios.get(profileLaunch_URL, { headers: HEADERS });
const browserURL = `http://127.0.0.1:${response.data.data.port}`;
// if you prefer to connect with browserWSEndpoint, try to get the webSocketDebuggerUrl by following request
// const {data : {webSocketDebuggerUrl}} = await axios.get(`${browserURL}/json/version`)
const browser = await chromium.connectOverCDP(browserURL,{timeout:10000});
const context = browser.contexts()[0];
const page = await context.newPage();
await page.goto("https://multilogin.com/");
await page.screenshot({path: "example.png"});
await page.close();
} catch (error) {
console.log("Error:", error.message);
if (error.response) {
console.log("Response data:", error.response.data);
}
}
};
start_browserProfile();
Python
- Make sure the agent is connected, as it makes profile launching possible
- Make sure Playwright is compatible with the current Mimic core version – check the release notes for Playwright and Mimic
- Run the
.py
file with your automation code
Script example
import hashlib
import requests
import time
from playwright.sync_api import sync_playwright
MLX_BASE = "https://api.multilogin.com"
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 sign_in() -> 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
HEADERS["Authorization"] = f"Bearer {sign_in()}"
def start_profile():
with sync_playwright() as pw:
resp = requests.get(
f"https://launcher.mlx.yt:45001/api/v2/profile/f/{FOLDER_ID}/p/{PROFILE_ID}/start?automation_type=playwright&headless_mode=false",
headers=HEADERS)
resp_json = resp.json()
if resp.status_code != 200:
print(f"\nError while starting profile: {resp.text}\n")
return
else:
print(f"\nProfile {PROFILE_ID} started.\n")
browserPort = resp_json["data"]["port"]
browserURL = f"http://127.0.0.1:{browserPort}"
# if you prefer to connect with browserWSEndpoint, try to get the webSocketDebuggerUrl by following request
# response = requests.get(f'{browserURL}/json/version')
# browser_ws_endpoint = response.json()["webSocketDebuggerUrl"]
browser = pw.chromium.connect_over_cdp(endpoint_url=browserURL)
context = browser.contexts[0]
page = context.new_page()
page.goto('https://www.multilogin.com')
time.sleep(5)
page.screenshot(path='example.png')
page.close()
start_profile()