LoginSignup
3
1

More than 5 years have passed since last update.

Capybara の headless chrome で Accept-Language ヘッダを送る設定

Last updated at Posted at 2017-12-01
Capybara.register_driver :headless_chrome do |app|
  Capybara::Selenium::Driver.new(app,
    browser: :chrome,
    desired_capabilities: Selenium::WebDriver::Remote::Capabilities.chrome(),
    options: Selenium::WebDriver::Chrome::Options.new(
      args: %w(--headless --disable-gpu --lang=ja-JP)
    )
  )
end

ポイントは、--lang=オプションを使うこと。

https://peter.sh/experiments/chromium-command-line-switches/ あたりに載ってた。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1