PyVirtualDisplay is python wrapper for Xvfb, Xephyr and Xvnc.
Questions tagged [pyvirtualdisplay]
82 questions
1
vote
1 answer
find_element is not printing the actual text
from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
display = Display(visible=0, size=(800, 600))
display.start()
driver =…

No Sssweat
- 358
- 1
- 6
- 24
1
vote
3 answers
No module named request PythonAnywhere error
I need to use urllib module in my code and I import it like this:
import urllib.request
import urllib.error
but PythonAnywhere returns the following error:
> No module named request
It looks like the urllib library is imported successfully when I…

Steve
- 722
- 4
- 10
- 24
1
vote
1 answer
Selenium Stucks on pyvirtualdisplay
I am running Selenium python on server where I need to hide chrome display. Python script runs most of time but sometimes it stucks when it creates new chromedriver session. Don't have any idea why it stucks sometimes.
Snippet Code:
from selenium…

iNikkz
- 3,729
- 5
- 29
- 59
1
vote
1 answer
Using clipboard with pyvirtualdisplay
I have a script that is ran in pyvirtualdisplay and I need a value of a variable copied to my clipboard.
The following works (simplified version of my script):
from selenium import webdriver
import clipboard
driver =…

Neekoy
- 2,325
- 5
- 29
- 48
1
vote
1 answer
pyvirtualdisplay on Amazon EC2 instance
I am trying to run selenium on Amazon EC2. I am using pyvirtualdisplay as xvfb wrapper. I ran the following commands in python.
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(1024,…

nishantsingh
- 4,537
- 5
- 25
- 51
1
vote
1 answer
Selenium - screenshot images taken by headless server are mangled
I am using selenium webdriver (Python version) to take images of a web page after it loads. When I go to a page and save an image using a python script on my local computer, it looks fine. However, I am running the script on a server and there the…

user3421410
- 337
- 1
- 3
- 10
1
vote
1 answer
The browser appears to have exited before we could connect. The output was: mkdir: cannot create directory
I had a python script running successfully. The .py script would open a headless browser(pyvirtualdisplay & xvfb) and perform a task and then close the browser. I had an issue with xvfb processes being left open after the script is run. After its…

Cosco Tech
- 565
- 1
- 4
- 22
1
vote
0 answers
Run chrome headless on Selenium
I would like to run a selenium-test using headless chrome.
First I downloaded the chromedriver and passed its location as parameter:
null=open('/dev/null','wb')
cmd =…

Kesandal
- 1,263
- 4
- 11
- 15
1
vote
1 answer
Why do I get a gnome permissions error when I run Selenium using PyVirtualDisplay from a Django website?
I’m trying to use Python’s Selenium bindings to programmatically interact with websites, as part of a Django website.
As my Selenium code runs as part of a Django website, by default (if I understand correctly) there is no display available for the…

Paul D. Waite
- 96,640
- 56
- 199
- 270
0
votes
0 answers
Python, Flask, Selenium, and Pyvirtualdisplay; can't find Xvfb
I'm trying to use Pyvirtualdisplay in my Flask backend, but it can't find Xvfb. This is my code:
@app.route('/test-selenium', methods=('GET',))
def test_selenium():
display = Display(visible=0, size=(800, 600))
display.start()
options =…

Flask Programmer
- 9
- 2
0
votes
1 answer
Selenium how to testing without browser and GUI
I hope you're doing well,
I'm trying to run selenium test with no GUI and no browser, I found this code:
#!/usr/bin/env python
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(800,…

Jonathan Viana
- 47
- 6
0
votes
0 answers
Pyvirtualdisplay under wsl2 : pyvirtualdisplay.abstractdisplay.XStartTimeoutError: No reply from program Xvfb
Here is the code I am using
from pyvirtualdisplay import Display
virtual_display = Display(visible=0, size=(1400, 900))
virtual_display.start()
this results in
XStartTimeoutError
No reply from program Xvfb. command:['Xvfb', '-br', '-nolisten',…

Rotkiv
- 1,051
- 2
- 13
- 33
0
votes
0 answers
Selenium with pyvirtualdisplay raises error without an active ssh connection
I have a selenium script that works if launched manually (arm64 Ubuntu VM) while connected via ssh.
If I set it to run via crontab, it still works while ssh connection is active.
Instead if I exit the connection, then it starts giving me this…

albertopasqualetto
- 87
- 1
- 1
- 11
0
votes
0 answers
pyvirtualdisplay: FileNotFoundError: [WinError 2] The system cannot find the file specified
I am trying to use "pyvirtualdisplay" to scrape a dynamic Javascript website while using a headless Chrome. I am on Windows and installed "pyvirtualdisplay" via pip
My code to run the headless chrome is as follows:
from pyvirtualdisplay import…

123456
- 393
- 3
- 12
0
votes
1 answer
Pytest core dump on Unbutu 22.04 LTS when using pyqt5 with mayavi and pyvirtualdisplay
Want I want to do:
I want to have these requirements running on Ubuntu 22.04 LTS:
# Bug on Ub.22.04 but avoids AttributeError: 'Timer' object has no attribute 'start' on other OS
pyqt5==5.15.7
# These together…

WaterFox
- 850
- 6
- 18