I
I
Igor Mitrakov2018-03-06 09:35:10
Python
Igor Mitrakov, 2018-03-06 09:35:10

Is it possible to use selenium on python without a graphical shell on linux?

I am writing a parser that will be installed on a server with linux OS. Would it be possible to use selenium?
Why did I choose selenium, and not, for example, Grab, because I need to work with js loaded with the page.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nick Kitovsky, 2018-03-12
@kitovsky

I am using Xvfb in conjunction with pyvirtualdisplay for python.
Usage example:
from pyvirtualdisplay import Display
display = Display(visible=0, size=(800, 600))
display.start()
# run webdriver here and do whatever
display.stop()
800, 600 is the virtual screen resolution, so you can also specify the color depth and other parameters.

V
Vladimir, 2018-03-06
@vintello

selenium + headless
for example like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question