Skip to main content
All CollectionsAPI
Automation of the Processes With Selenium
Automation of the Processes With Selenium
S
Written by Serge
Updated over 2 years ago

With some moves that take too much unnecessary effort, using Selenium to automate tasks can become a convenient way to minimize the workload. With its help the user scripts the scenario that should be executed to automate web browser routine.

The specifics of GoLogin allow it to run the Selenium browser codes with the Google driver software. To set up the Selenium browser automation, first search for github.com/gologinapp/gologin repository, selenium directory.

For automated website interaction, the most convenient coding language is Python, as it provides reliable technical support in case of trouble. However, in general, because of multiple specific interactions, the Selenium framework operates with many existing language bindings.

To get started, open the driver to insert the necessary information. The code for Selenium browser in Python has such structure:

import time

from sys import platform

from selenium import webdriver

from selenium.webdriver.chrome.options import Options

from gologin import GoLogin

gl = GoLogin({

'token': 'yU0token',

'profile_id': 'yU0Pr0f1leiD',

})

if platform == "linux" or platform == "linux2":

chrome_driver_path = './chromedriver'

elif platform == "darwin":

chrome_driver_path = './mac/chromedriver'

elif platform == "win32":

chrome_driver_path = 'chromedriver.exe'

debugger_address = gl.start()

chrome_options = Options()

chrome_options.add_experimental_option("debuggerAddress", debugger_address)

driver = webdriver.Chrome(executable_path=chrome_driver_path, options=chrome_options)

driver.get("http://www.python.org")

assert "Python" in driver.title

driver.close()

time.sleep(3)

gl.stop()

Especially important are the following points:

  1. Creation of GoLogin class instance, which specifies access token and profile for running the command.

  2. Launching remote brother, transmission of obtained links to Selenium.

  3. Opening python.org for making sure the command was set correctly.

Note. After the command application for Selenium, close browser driver and initiate the profile stop for the correct setup process.

In order to ease the work with Selenium web browser automation, the extensions can be used as a convenient management tool. The examples of such, supported by GoLogin, can be found below, and, if necessary โ€“ installed from the Chrome store.

Did this answer your question?