Skip to content

Instantly share code, notes, and snippets.

@miztiik
Last active May 23, 2023 20:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miztiik/60d8ba679d2668e2afd18b8a574a08d3 to your computer and use it in GitHub Desktop.
Save miztiik/60d8ba679d2668e2afd18b8a574a08d3 to your computer and use it in GitHub Desktop.
Script to setup headless Selenium (uses Xvfb & Firefox) in Redhat
pip install selenium
pip install xvfbwrapper
yum install -y firefox
# Install the geckodriver
cd /tmp
curl -SO https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-linux64.tar.gz | tar zxv - -C /usr/sbin
yum install -y xorg-x11-server-Xvfb
# yum install -y xorg-x11-Xvfb
# pip install pyvirtualdisplay
echo "Starting X virtual framebuffer (Xvfb) in background..."
Xvfb -ac :99 -screen 0 1280x1024x16 &
export DISPLAY=:99
@mattp-613
Copy link

Hi, I'm a bit of a dummy. I did this remotely, how do I switch the display on my server to firefox? Does it work with RHEL 8?

@miztiik
Copy link
Author

miztiik commented May 23, 2023

I have no idea, i was working on a experiment back then. Good Luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment