How can I set the browser window size when using `google-chrome –headless`?

I found it. Simply pass the –window-size command line argument to Google Chrome, for example –window-size=1920,1080. In a Protractor configuration this would look like this: capabilities: { browserName: ‘chrome’, chromeOptions: { args: [‘headless’, ‘window-size=1920,1080’] } } The cool thing is that the windows size is not limited to the current display. It is truly headless, … Read more

Any way to start Google Chrome in headless mode?

TL;DR google-chrome –headless –remote-debugging-port=9222 http://example.com You’d also need –disable-gpu temporarily. Tutorial: https://developers.google.com/web/updates/2017/04/headless-chrome There’s a work in progress: https://code.google.com/p/chromium/issues/detail?id=546953 The main deliverables are: A library which headless applications can link to to. A sample application which demonstrates the use of headless APIs. So it would be possible to create a simple application that runs in console … Read more

How to manage log in session through headless chrome?

There is an option to save user data using the userDataDir option when launching puppeteer. This stores the session and other things related to launching chrome. puppeteer.launch({ userDataDir: “./user_data” }); It doesn’t go into great detail but here’s a link to the docs for it: https://pptr.dev/#?product=Puppeteer&version=v1.6.1&show=api-puppeteerlaunchoptions

“No X11 DISPLAY variable” – what does it mean?

If you’re on the main display, then export DISPLAY=:0.0 or if you’re using csh or tcsh setenv DISPLAY :0.0 before running your app. Actually, I’m surprised it isn’t set automatically. Are you trying to start this application from a non-graphic terminal? If not, have you modified the default .profile, .login, .bashrc or .cshrc? Note that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)