Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purpose of PyVirtualDisplay #58

Closed
shawnngtq opened this issue Nov 5, 2020 · 6 comments
Closed

Purpose of PyVirtualDisplay #58

shawnngtq opened this issue Nov 5, 2020 · 6 comments

Comments

@shawnngtq
Copy link

shawnngtq commented Nov 5, 2020

I read online and happen to come across this library and selenium. I am curious to understand what is the purpose of this library?

Based on what I read, I thought we can still continue to scrape data using selenium, without this python wrapper for virtual display? (https://selenium-python.readthedocs.io/getting-started.html)

I wasn't able to find a good documentation to explain this. Can anyone enlighten me? I am not expert in either libraries. Thanks!

@ponty
Copy link
Owner

ponty commented Nov 23, 2020

You find the answer in the README: "pyvirtualdisplay is a python wrapper for Xvfb, Xephyr and Xvnc"

I'dont know Selenium but you can ask your questions about it in the Selenium project forum.

@DobroAlex
Copy link

@shawnngtq , it' really simple. I have a project where I need to visit some urls, take screenshots and recognize text using Tesseract. The first option is to take a screenshot of an arbitrary size is to run chrome headless. On the other hand, any decent anti bot system will block a headless browser on sight. The other solution is to run a headfull browser. The problem here is that it requires some window manager and you can't simply install Gnome and expect Chrome to launch if you're using SSH as SSH "doesn't see" (a poor choice of words) any displays. So I'm using this lib to create a big sized xvfb and an arbitrary sized Chrome.

@ponty , I'm appreciating your job a lot. This package really saves a lot of time for someone who works with browsers and anti bot systems

@shawnngtq
Copy link
Author

@DobroAlex
You can run headless selenium, but some website would block these. With pyvirtualdisplay, if visible=False, even though it looks headless, but the selenium that runs within it is not headless, therefore wouldn't be block. Is my understanding correct? 😄

@mals14
Copy link

mals14 commented Mar 3, 2021

Is my understanding correct?

That would indeed be useful to know. Although, I think there are websites that can tell that it is controlled selenium visiting even when selenium is not running headless.

@FernandoRD
Copy link

Hi, I have a question, don´t know if here is the right to place to ask...
I want to know if PyVirtualDisplay can work together with wfreerdp (https://github.com/FreeRDP/FreeRDP/wiki/PreBuilds)
My need is to build a sensor in Nagios that tries to connect to a windows server to verify if the RDP service is OK.
There are sensors to do it, but they only test if the server accepts the connection. In my case the problem is that the server accepts it but the screen doesn´t load properly... It will have to run headless.... thankyou.

@ponty
Copy link
Owner

ponty commented Jul 13, 2021

Xvfb is for X display server, not for Windows. PyVirtualDisplay only starts Xvfb in headless mode.

https://en.wikipedia.org/wiki/Xvfb

@ponty ponty closed this as completed Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants