Skip to main content

How to Use Selenium With Your Python Discord Bot

1. Select a Python Version

Within the Startup page on your panel, select your desired Python version (you must select the Docker image from Cybrancee). This must also be for a Python version that is 3.8 or later.

Cybrancee panel python versions

2. Add Selenium to ‘ADDITIONAL PYTHON PACKAGES’ Field

Add “selenium” to your Additional Python Packages field, and enable the toggle for Install Selenium.

Cybrancee panel startup screen, with fields outlined

3. Select ‘Reinstall Server’

Select the ‘Settings‘ Tab and scroll down

Cybrancee_Panel_Settings_Tab_Reinstall

4. Select the Drop-Down Menu


5. Select the ‘Delete current files and reinstall server‘ Reinstall Option

Cybrancee_Options_Re-Install
Delete current files and reinstall serverWipes all current files and performs a clean reinstall. Useful when you want a completely fresh start, whilst keeping any settings configured on the startup page.

6. Select ‘Continue’

Cybrancee_Select_Continue

7. Select ‘Confirm reinstall’


8. Selenium is Now Installed and Enabled

When you use Selenium, you will always need to include the following parameters and includes within your code:

Python
from selenium import webdriver
from selenium.webdriver.chrome.service import Service

service = Service(executable_path="./webdriver/chromedriver")

options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
options.add_argument('--disable-extensions')
options.add_argument('--dns-prefetch-disable')

driver = webdriver.Chrome(service=service, options=options)

#EXAMPLE USAGE BELOW 
driver.get("https://cybrancee.com")
print(driver.title)

#OUTPUT:
#>> Website Hosting and Free Domain

Discord Bot Hosting

Starts at $1.49

External link icon
Was this article helpful?
Please Share Your Feedback
How Can We Improve This Article?
Table of Contents