I could not get a clear answer on whether or not CEF python can be used in pure headless mode (no Xvfb or other) to take screenshots of the web page. I know about the offScreen option. But I don't see any option to set the size or viewport of CEF. And from my incomplete test, CEF doesn't load the URL if there's no X library used (GTK or QT, for example).
Asked
Active
Viewed 1,009 times
10
-
Any reason you have to use cefpython? I'm just wondering whether [selenium with the chrome driver](http://docs.seleniumhq.org/projects/webdriver/) might suit your needs and be easier. – J Richard Snape May 14 '16 at 22:53
-
Yes, I need much more control that given by Selenium, and more scalability – Julien May 17 '16 at 22:52
-
There are callbacks such as GetRootScreenRect, GetViewRect, etc. in [RenderHandler](https://github.com/cztomczak/cefpython/blob/master/api/RenderHandler.md#renderhandler-interface) that allow to set the size. CEF supports xvfb. – Czarek Tomczak Apr 14 '17 at 17:43
-
1Found this today, Chromium v59 will support headless mode: https://www.chromestatus.com/features/5678767817097216 - whether this means no X11 dependency is yet to check – Czarek Tomczak Apr 15 '17 at 05:22
1 Answers
1
As far as I know CEF is based on Chromium engine which doesn't support pure headless mode on Linux. You can try at least starting X Server and check if it's enough to use CEF for screenshots. I guess running only X Server should be enough for this.

Vladimir
- 1
- 1
- 23
- 30