Headless Selenium + Xvfb + Chrome on OSX 10.11

So, at first I found out that xvfb was not included in my version of osx, so I installed it from: http://www.xquartz.org/

and it seemed to work:

which xvfb /opt/X11/bin/xvfb 

But when I try to use it with pyvirtualdisplay and xvfbwrapper, following the tips I found on this question How to run Selenium in Xvfb? My script works without error, and just opens in a Chrome browser window.

 from selenium import webdriver from pyvirtualdisplay import Display display = Display(visible=0, size=(800, 600)) display.start() browser = webdriver.Chrome() browser.get('google.com') 

Am I doing something wrong here?

+5
source share
1 answer

I believe that Chrome was created for the Quartz ui framework, so it ignores the X11 window engine. You will need to install the X11 browser version and execute it.

+4
source

Source: https://habr.com/ru/post/1237080/


All Articles