GenLogin
  • Genlogin's Technology
  • Group profiles
    • Create profile
      • Overview
      • Network And WEBRTC
      • Location
      • Advanced settings
      • Cookies
    • Extensions
    • Local and Cloud profiles
    • Group profiles
    • Change owner profile
    • Share profile
    • Team-member
    • Email and password
    • Captcha service
    • Support center
  • Genlogin API
    • Profile API
      • 1. Profile list
      • 2. Create profile
      • 3. Run profile
      • 4. Stop profile
      • 5. Delete profile
    • Github Examples
  • Record automation
    • Overview
    • Puppeteer
    • Selenium
  • Automation guide
    • Overview
    • Running automation separately following profile group
  • ABOUT
    • FAQ
      • How to use Genlogin?
      • What operating systems does the software support?
      • Can I use my account on different computers at the same time?
      • How many accounts can I use in 1 computer?
      • How to pay for the invoice?
      • If I cannot pay on time, will I lose all my data?
      • How long will I wait prior to the activation of my subscription?
      • How to change the subscription plan?
Powered by GitBook
On this page
  • For Python:
  • Install:
  • Example:
  • For C#:
  • Example:
  1. Record automation

Selenium

For Python:

Install:

pip install selenium

Example:


from Genlogin import Genlogin
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service

gen = Genlogin("")
profileID = gen.getProfiles(0,1)["profiles"][0]["id"]
wsEndpoint = gen.runProfile(profileID)["wsEndpoint"].replace("ws://","").split('/')[0]

chrome_driver = 'chromedriver.exe'
chrome_options = Options()
chrome_options.add_experimental_option("debuggerAddress", wsEndpoint)

service = Service(executable_path=r'chromedriver.exe')
driver = webdriver.Chrome(service=service, options=chrome_options)
driver.get("https://genlogin.com")
time.sleep(5)
gen.stopProfile(profileID)

For C#:

Example:

 var gen = new Genlogin("");
 var profile = await gen.GetProfiles(1, 0);
 JObject jsonObject = JObject.Parse((string)profile);
 int profileID = (int)jsonObject["data"]["lst_profile"][0]["id"];
 var profileRun = await gen.runProfile(profileID);
 JObject jsonObjectprofileRun = JObject.Parse((string)profileRun);
 string wsEndpoint = ((string)jsonObjectprofileRun["wsEndpoint"]).Split('/')[2];
 var chromeDriverPath = "chromedriver.exe"; 
 var chromeOptions = new ChromeOptions();
 chromeOptions.DebuggerAddress = wsEndpoint;
 var service = ChromeDriverService.CreateDefaultService(chromeDriverPath);
 var driver = new ChromeDriver(service, chromeOptions);

 driver.Navigate().GoToUrl("https://genlogin.com");

 gen.stopProfile(profileID);

 driver.Quit();
PreviousPuppeteerNextOverview

Last updated 1 year ago

Page cover image
GitHub - hsxonz/lib_Genlogin_pyGitHub
GitHub - hsxonz/Genlogin-CSharpGitHub
Logo
Logo