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.

Puppeteer ignoring lang arg to launch

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 3.10
  • Platform / OS version: OSX 10.14.6
  • URLs (if applicable):
  • Node.js version: 10.9.0

What steps will reproduce the problem?

  1. npm install puppeteer
  2. run the following code:
const puppeteer = require("puppeteer");

(async function() {
  const u = "https://www.google.com/search?q=foo"
  const browser = await puppeteer.launch({
    headless: false,
    args: ['--lang="en-US"'],
  });
  page = await browser.newPage();
  await page.goto(u);
})();
  1. I am in Israel the results are in Hebrew and sometimes German oddly enough.
  2. When I launch my local chromium like this: $ node_modules/puppeteer/.local-chromium/mac-756035/chrome-mac/Chromium.app/Contents/MacOS/Chromium --lang="en-US" and search for “foo” my results are in English.

What is the expected result? Chromium should be launched in the language specified by the lang arg.

What happens instead? Chromium seems to launch in the language of my location and ignores the lang arg to launch. Screen Shot 2020-06-04 at 3 38 34 PM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

7reactions
davidjgosscommented, Sep 10, 2020

Per this comment https://bugs.chromium.org/p/chromium/issues/detail?id=755338#c14 seems this isn’t really supposed to work and we should be using the LANG environment variable instead.

h/t @dom54

4reactions
UInIQcommented, Dec 1, 2020

@davidjgoss Speaking as someone who just spent FAR longer than he’d like to have beating his head against this particular wall, I wanted to, with all the grateful sincerity I can muster, compliment you on your anal-retentive attention to detail, both in finding that little nugget, and then remembering to come back here and post the update some three months after the initial question was posted and some two months after the most recent activity.

Wow, man. I can barely remember what I had for lunch on Sunday. My (evident) mnemonic shortcomings aside, though, honestly: thanks for taking the time. You just saved me a much larger headache than I’d already built up. You’re appreciated. ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ignore Puppeteer arg "--remote-debugging-port=0"
Puppeteer can connect to chrome in two ways: Using pipes puppeteer.launch({pipe: true}); . This will add the flag --remote-debugging-pipe .
Read more >
Launch Options – Browserless Docs
Be careful ignoring these args as it might cause chromium to become unstable or refuse to launch.
Read more >
Troubleshooting - Puppeteer
Ensure that you're using '--no-sandbox' mode when launching Puppeteer. This can be done by passing it as an argument to your .launch() call:...
Read more >
@kintone/plugin-uploader - npm
Start using @kintone/plugin-uploader in your project by running `npm i ... zip and re-run --lang Using language (en or ja) --puppeteer-ignore-default-args ...
Read more >
Step by Step Guide to Web Scraping JavaScript Content using ...
Puppeteer is to run Chromium or Firefox in headless and non-headless mode. But developers run in ... ignoreHTTPSErrors: true, // ignore https error...
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