This package provides functionality to run and stop GoLogin profiles with python and then connect the profiles to automation tools like Selenium, Puppetteer, Playwright etc.
Check full gologin documentations here.
- You give SDK your dev token and profile id that you want to run
- SDK takes care of downloading, preparing your profile and starts the browser
- SDK gives you websocket url for automation tools
- You take this websocker url and connect it to the automation tool on your choice: Puppetteer, Selenium, Playwright etc
- Automation tool connects to browser and you can manage it through code
Where is token? API token is here.
pip3 install gologin
for base case - we use selenium as it is the most popular tool
pip3 install -r requirements.txt
import time
from gologin import GoLogin
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
profile_id = "Your profile id"
# Initialize GoLogin
gl = GoLogin({
"token": "Your token",
"profile_id": profile_id
})
# Start Browser and get websocket url
debugger_address = gl.start()
# Get Chromium version for webdriver
chromium_version = gl.get_chromium_version()
# Add proxy to profile
gl.addGologinProxyToProfile(profile_id, "us")
# Install webdriver
service = Service(ChromeDriverManager(driver_version=chromium_version).install())
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option("debuggerAddress", debugger_address)
driver = webdriver.Chrome(service=service, options=chrome_options)
# Give command to Selenium to open the page
driver.get("http://www.python.org")
time.sleep(30)
driver.quit()
time.sleep(10)
gl.stop()python3 examples/selenium/one-time-use-profile.py
Required options:
token<[string]> Required - your API tokenprofile_id<[string]> Required - profile ID (NOT PROFILE NAME)
Optional options:
executablePath<[string]> path to executable Orbita file. Orbita will be downloaded automatically if not specifiedextra_paramsarrayof <[string]> additional flags for browser start. For example: '--headles', '--load-extentions=path/to/extension'uploadCookiesToServer<[boolean]> upload cookies to server after profile stopping (default false). It allows you to export cookies from api later.writeCookesFromServer<[boolean]> if you have predefined cookies and you want browser to import it (default true).
gl = GoLogin({
"token": "your token",
"profile_id": "your profile id",
"extra_params": ["--headless", "--load-extentions=path/to/extension"]
})createProfileRandomFingerprint - you pass os ('lin', 'win', 'mac') and profile name and we give you brand new shiny profile
gl = GoLogin({
"token": "your token",
})
profile = gl.createProfileRandomFingerprint({"os": "lin", "name": "some name"})
gl.setProfileId(profile['id'])createProfileWithCustomParams - This method creates a profile and you can pass any particular params to it. Full list of params you can find here - https://api.gologin.com/docs
gl = GoLogin({
"token": "your token",
})
profile = gl.createProfileWithCustomParams({
"os": "lin",
"name": "some name",
"navigator": {
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
"resolution": "1920x1080",
"language": "en-US",
"platform": "Linux x86_64",
"hardwareConcurrency": 8,
"deviceMemory": 8,
"maxTouchPoints": 0
}
})
gl.setProfileId(profile['id'])updateUserAgentToLatestBrowser - user agent is one of the most important thing in your fingerprint. It decides which browser version to run. This method help you to keep useragent up to date.
gl = GoLogin({
"token": "your token",
})
gl.updateUserAgentToLatestBrowser(["profineId1", "profileId2"], "workspceId(optional)")addGologinProxyToProfile - Gologin provides high quality proxies with free traffic for paid users. Here you can add gologin proxy to profile, just pass country code
gl = GoLogin({
"token": "your token",
})
gl.addGologinProxyToProfile("profileId", "us")addCookiesToProfile - You can pass cookies to the profile and browser will import it before starting
gl = GoLogin({
"token": "your token",
})
gl.addCookiesToProfile("profileId", [
{
"name": "session_id",
"value": "abc123",
"domain": "example.com",
"path": "/",
"expirationDate": 1719161018.307793,
"httpOnly": True,
"secure": True
},
{
"name": "user_preferences",
"value": "dark_mode",
"domain": "example.com",
"path": "/settings",
"sameSite": "lax"
}
])gl = GoLogin({
"token": "your token",
})
gl.refreshProfilesFingerprint(["profileId1", "profileId2"])gl = GoLogin({
"token": "your token",
})
gl.changeProfileProxy("profileId", { "mode": "http", "host": "somehost.com", "port": 109, "username": "someusername", "password": "somepassword"})gl = GoLogin({
"token": "your token",
"profile_id": "some_profile_id"
})
wsUrl = gl.start()start browser with profile id
gl = GoLogin({
"token": "your token",
"profile_id": "some_profile_id"
})
wsUrl = gl.start()
gl.stop()This package collects anonymous error data to help improve reliability.
- Set environment variable:
DISABLE_TELEMETRY=true
- No personal information collected
- Data stored securely
- Used only for bug fixes and improvements
Our full privacy policy you can finde here