question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blank screenshots when using --headless and --proxy-server at the same time.

See original GitHub issue

If I use chrome without the --headless option, everything works, which means traffic goes through the selected proxy, and when I capture the screens, the resulting images look the way I expect them to.

If I add --headless to the command line arguments, I start capturing blank screens.

I tried both Canary and Chromium.

Is there anything I can do figure out what’s going on? I added logging to the proxy, and I see only one connection happening, instead of several, which is what I see when “it works”.

Let me know if there’s something I can do. Thanks in advance.

Related issue: https://github.com/cyrus-and/chrome-remote-interface/issues/175

(I opened this one because the related one was already closed)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
0xhexdeccommented, Jan 20, 2021

For me, adding the --ignore-certificate-errors did the trick.

options = Options()
options.add_argument('headless')
options.add_argument('ignore-certificate-errors')
options.add_argument('--proxy-server=%s' % proxy_url)

driver = RemoteDriver(hubUrl, options=options)

Done with selenium python I run the tests in Selenium Grid (3) with Windows and Linux nodes.

hope this helps

1reaction
cyrus-andcommented, Jul 18, 2017

This is hardly a problem with this project, you should file and issue here.

Moreover, I cannot even start Chrome if I set both --headless and --proxy-server at the same time on Linux:

$ google-chrome --proxy-server=socks5://127.0.0.1:9050 --remote-debugging-port=9222 --headless
[0718/200052.562414:ERROR:headless_shell.cc(551)] Malformed proxy server url
Read more comments on GitHub >

github_iconTop Results From Across the Web

BrowserMob Proxy returning empty HTML response with ...
I have to implement it for both HEAD and HEADLESS RemoteDriver. For Head-Driver it is working like a charm. Code for my Head-Remote...
Read more >
Blank screenshot for the macOS using headless chrome
(1) Run chrome headless using this tutorial - https://intoli.com/blog/running-selenium-with-headless-chrome/ (2) Check the screenshot in the project folder.
Read more >
Making Chrome Headless Undetectable
Using MitmProxy and injected JavaScript feature mocks to bypass Headless Chrome detection tests.
Read more >
Web Scraping with Selenium in Python - ZenRows
Learn how to navigate and scrape websites using Selenium in Python, ... You can achieve all of that and more with this headless...
Read more >
How to take website screenshots with Puppeteer - Urlbox
Learn how to capture website screenshots using headless chrome via the ... we can use a proxy server with puppeteer to make it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found