Force language?

Hello, In general on Apify, it is possible to force the browser language? (example: fr or es or en) I have tested with:
"proxy": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"],
"countryCode": "FR",
"apifyProxyCountry": "FR"
},
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"],
"countryCode": "FR",
"apifyProxyCountry": "FR"
},
"proxy": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"],
"countryCode": "FR",
"apifyProxyCountry": "FR"
},
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"],
"countryCode": "FR",
"apifyProxyCountry": "FR"
},
5 Replies
Hall
Hall3mo ago
Someone will reply to you shortly. In the meantime, this might help:
Pepa J
Pepa J3mo ago
Hi @Nico64 , code sample that you mentioned is related to the setup of Proxy configuration. You should be able to set a a browser language via launch arguments in Crawler defition. For example for Chrome and German language it should be:
const crawler = new PuppeteerCrawler({
proxyConfiguration,
requestHandler: router,
launchContext: {
launchOptions: {
args: [
'--accept-lang=de',
'--lang=de',
],
},
},
});
const crawler = new PuppeteerCrawler({
proxyConfiguration,
requestHandler: router,
launchContext: {
launchOptions: {
args: [
'--accept-lang=de',
'--lang=de',
],
},
},
});
There are also other ways how to set the browser language https://stackoverflow.com/a/47292022
Stack Overflow
How to specify browser language in Puppeteer
I would like to launch a Google Chrome browser with language Spanish es using Puppeteer. I've tried puppeteer.launch(args:['--lang=es',...],...) but it didn't work. I've tried passing the environ...
optimistic-gold
optimistic-goldOP3mo ago
Hi @Pepa J Thanks for your answer. I should have specified, I'm talking about when launching an Actor from the Apify API. It seems to be possible to specify the configuration of a proxy in the HTTP request to an Actor, is it possible to specify the browser language? Maybe it depends on the Actor? I asked the developer of an Actor I use but he doesn't answer.
Pepa J
Pepa J3mo ago
Ah yes, in case you are not the developer of the Actor there is not default way to do this from the API/Actor's Input. This needs to be directly developed.
optimistic-gold
optimistic-goldOP3mo ago
Ok I understand. Thank you for your help 👍

Did you find this page helpful?