Running Selenium headless without using xvfb

后端 未结 3 1400
野趣味
野趣味 2021-02-03 13:12

I\'m trying to run Selenium headless (without the browser appearing). Other questions have pointed to xvfb as the tool to do this. However, it appears highly unstab

3条回答
  •  广开言路
    2021-02-03 13:25

    I don't think you'll be able to run a browser without running an X server.

    If you don't like Xvfb, then as Pascal said, your best bet might be to run a VNC server -- I personally like Xtightvnc. This means you're running a (headless) X server that you can VNC into at any time, in case things go wrong and you want to look at it. I always have a VNC server running, and I'm running my tests with the $DISPLAY environment variable pointing to that server.

    (Someone's downvoted me, so maybe I should clarify: X11 VNC servers like Xtightvnc are not the same as the usual VNC servers on Windows or OS X, which would simply share your existing screen on the network. Do not confuse. ;-) )

提交回复
热议问题