• Website
  • Server status
  • API documentation
  • Blog
Telegram Icon Community
EN
English
Português
Русский
中文 (中国)
Tiếng Việt
Log in Try for €1.99
  • Website
  • Server status
  • API documentation
  • Blog
  • Telegram Icon Community
  • English (US)
    English
    Português
    Русский
    中文 (中国)
    Tiếng Việt
Log in View Plans

Puppeteer, Selenium, and Playwright

Control browser profiles programmatically with Puppeteer, Selenium, and Playwright. Automate web interactions, scraping, and profile management at scale.

search icon

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Getting started with Multilogin automation
  • Basic automation with CLI
  • Low-code automation with Postman
  • Script runner & predefined scripts
  • Puppeteer, Selenium, and Playwright
  • Custom Python scripts
  • Quick solutions with Developer Tools
  • External automation tools
  • Home
  • breadcrumb separator bar
  • Multilogin (latest)
  • breadcrumb separator bar
  • Efficient task automation with API
  • breadcrumb separator bar
  • Puppeteer, Selenium, and Playwright
  • breadcrumb separator bar
  • Selenium automation example

Selenium automation example

Written by Jason N ( Updated on March 27th, 2026 )

Updated on March 27th, 2026

This simple automation script in Python uses the Selenium library to manipulate a profile in Multilogin. It performs the following actions:

  1. Sign in using Multilogin API
  2. Start the profile defining Selenium as the selected automation type
  3. Retrieve the port used by the running profile
  4. Start a Selenium driver on localhost using the retrieved port
  5. Use the driver to manipulate browser actions
  6. Stop the profile in 5 seconds

Before you start

  1. Install the following Python libraries:
    1. requests
    2. selenium
  2. Insert your values into the below variables in the script:
    1. USERNAME: your Multilogin account email
    2. PASSWORD: your Multilogin account password (MD5 encryption is not required)
    3. FOLDER_ID, PROFILE_ID: find these values using our guides on DevTools or Postman

Running the script

  1. Launch the app, as it makes profile launching possible
  1. By default, the script below works for Mimic. To use it for Stealthfox, replace options=ChromiumOptions() with options=Options() in the following line:
    driver = webdriver.Remote(command_executor=f'{LOCALHOST}:{selenium_port}', options=ChromiumOptions()) 
  2. 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()
 
 

 

automation selenium selenium example code example selenium script api

Was this article helpful?

Give feedback about this article

In this article

  • Before you start
  • Running the script
  • Script example

Multilogin community

Stay informed, share your thoughts, and engage with others!

Telegram Icon Join us on Telegram

Read more on the topic

Blog Post Img

10 Best Datacenter Proxies for Web Scraping (2025 Edition)

Apr 2, 2025 5 min read
Google SERP Img

What is a Google SERP Proxy and Why Should You Care?

Apr 1, 2025 6 min read
UK Proxy Img

What Are Dedicated UK Proxies? Everything You Need to Know

Apr 1, 2025 6 min read
Related Article Title Icon

Related articles

  • Getting started with automation scripting
  • Puppeteer automation example
  • Playwright automation example
  • How to choose the best automation framework

Mobile

  • Cloud phone
  • Virtual phone
  • Remote phone
  • Phone farming
  • Cloud cell phone
  • Cloud Android emulation
  • AI Quick Action Automation

Multi-accounting

  • Multiple Instagram accounts
  • Multiple Tiktok accounts
  • Multiple Reddit accounts
  • Multiple Telegram accounts
  • Multiple Facebook accounts
  • Multiple Youtube accounts
  • Multiple LinkedIn accounts

COMPARISON

  • Multilogin vs. MoreLogin
  • Multilogin vs. FlashID
  • Multilogin vs. DuoPlus
  • Multilogin vs. VMOS cloud
  • Multilogin vs. Octo Browser
  • Multilogin vs. AdsPower
  • Multilogin vs. GoLogin

Platform proxies

  • Mobile proxy
  • Reddit proxy
  • Instagram proxy
  • TikTok proxy
  • Facebook proxy
  • Youtube proxy
  • LinkedIn proxy

USECASES

  • Cloud phones for Tiktok
  • Cloud phones for Instagram
  • Cloud phones for Reddit
  • Cloud phones for Facebook
  • Cloud phones for Youtube

RESOURCES

  • Knowledge base
  • API documentation
  • Glossary
  • Academy
  • Blog
  • Server status
  • Release notes

FREE TOOLS

  • YouTube views to money calculator
  • Instagram money calculator
  • Online URL to text converter
  • Google local SERP checker
  • Random address generator

GET IN TOUCH

  • Contact 24/7 support
    [email protected]
  • Referral program
  • Affiliate program
  • Pricing page
  • Careers
GDPR Compliant

© 2026 Multilogin. All rights reserved.

  • Privacy policy
  • Terms of service
  • Cookie policy
Multilogin watermark
  • MOBILE

    • Cloud phone
    • Virtual phone
    • Remote phone
    • Phone farming
    • Cloud cell phone
    • Cloud Android emulation
    • AI Quick Action Automation
  • MULTI-ACCOUNTING

    • Multiple Instagram accounts
    • Multiple Tiktok accounts
    • Multiple Reddit accounts
    • Multiple Telegram accounts
    • Multiple Facebook accounts
    • Multiple Youtube accounts
    • Multiple LinkedIn accounts
  • COMPARISON

    • Multilogin vs. MoreLogin
    • Multilogin vs. FlashID
    • Multilogin vs. DuoPlus
    • Multilogin vs. VMOS cloud
    • Multilogin vs. Octo Browser
    • Multilogin vs. AdsPower
    • Multilogin vs. GoLogin
  • PLATFORM PROXIES

    • Mobile proxy
    • Reddit proxy
    • Instagram proxy
    • TikTok proxy
    • Facebook proxy
    • Youtube proxy
    • LinkedIn proxy
  • USECASES

    • Cloud phones for Tiktok
    • Cloud phones for Instagram
    • Cloud phones for Reddit
    • Cloud phones for Facebook
    • Cloud phones for Youtube
  • RESOURCES

    • Knowledge base
    • API documentation
    • Glossary
    • Academy
    • Blog
    • Server status
    • Release notes
  • FREE TOOLS

    • YouTube views to money calculator
    • Instagram money calculator
    • Online URL to text converter
    • Google local SERP checker
    • Random address generator
  • GET IN TOUCH

    • Contact 24/7 support
      [email protected]
    • Referral program
    • Affiliate program
    • Pricing page
    • Careers
GDPR Compliant
  • Privacy policy
  • Terms of service
  • Cookie policy

© 2026 Multilogin. All rights reserved.

Expand