splinter icon indicating copy to clipboard operation
splinter copied to clipboard

Chrome headless not redirecting

Open ghost opened this issue 9 years ago • 11 comments

I have told chrome headless to visit a page which issues a redirect, but the redirect is never happening. It just sits on the page... Is there some special command that I need to tell it to follow the redirect chain down?

ghost avatar Aug 10 '17 21:08 ghost

I too am experiencing this issue.

hyrumwhite avatar Aug 24 '17 22:08 hyrumwhite

me too

ghost avatar Sep 09 '17 22:09 ghost

fail-test_132_c2_dzaf2e I am also experiencing a similar glitch when trying to run chrome headless using the splinter browser variable.

For example, here is the code I use before a scenario is run to initialize the browser:

def before_scenario(context, scenario): serv_args = [ "--ignore-ssl-errors=yes"] #chrome or phantomjs, set in environment variables logging.info("RUNNING: " + scenario.name) print("Browser Test starting.\n") if os.environ['browser'] == 'firefox': context.browser = Browser(os.environ['browser']) elif os.environ['browser'] == 'chrome': context.browser = Browser(os.environ['browser'], service_args=serv_args) else: context.browser = Browser(os.environ['browser'], service_args=serv_args)

When I do not include the headless=True tag the page redirects fine

As soon as I include the headless=True argument in my browser setup Chrome is unable to redirect and it the screenshot is just a plain white screen.

def before_scenario(context, scenario): serv_args = [ "--ignore-ssl-errors=yes"] #chrome or phantomjs, set in environment variables logging.info("RUNNING: " + scenario.name) print("Browser Test starting.\n") if os.environ['browser'] == 'firefox': context.browser = Browser(os.environ['browser']) elif os.environ['browser'] == 'chrome': context.browser = Browser(os.environ['browser'], headless=True,service_args=serv_args) else: context.browser = Browser(os.environ['browser'], service_args=serv_args)

rmeyer1 avatar Nov 14 '17 22:11 rmeyer1

same for selenium and chrome webdriver

ghost avatar May 30 '18 11:05 ghost

I have the same issue too

lowe0506 avatar Jun 05 '18 07:06 lowe0506

defect on chrome driver, i believe root the same https://bugs.chromium.org/p/chromedriver/issues/detail?id=2440#c2

ghost avatar Jun 05 '18 07:06 ghost

so, have anyone solved this problem? Same bug confused me ...

meyougonglv avatar Jul 05 '18 02:07 meyougonglv

I used xvfb instead of chrome --headless as a workaround.

meyougonglv avatar Jul 14 '18 07:07 meyougonglv

I used a workaround to change the user-agent: chromeOptions.addArguments("--user-agent=Chrome/77"); This solved my issue, for now!

GuptaMegha avatar Oct 03 '19 11:10 GuptaMegha

I used a workaround to change the user-agent: chromeOptions.addArguments("--user-agent=Chrome/77"); This solved my issue, for now!

It works, huge thanks!

f4br3 avatar Mar 18 '20 12:03 f4br3

Closing, since this is a chromedriver issue and not a splinter issue.

javascript-error avatar Apr 06 '21 19:04 javascript-error