Google Translate web gives two different translations (chrome browser vs Selenium/chromedriver)

Question:

I’m having a similar issue to this question, but with German. When I use a Chrome browser on my pc I get one translation (from https://translate.google.com), but with Selenium (in headless mode) I get a different translation.

As an example, the following text gives two different results:

  • "Im Studienzimmer herrscht ein leises Murmeln der Studenten und ein etwas lauteres zischen der Chemikalien."
  1. Using Chrome browser:

    • "In the study room there is a soft murmur from the students and a somewhat louder hiss of the chemicals."
  2. Using Selenium:

    • "In the study room there is a quiet marbles of the students and a slightly louder hiss of the chemicals."

Why does German "Murmeln" get translated as ‘murmur’ by the translation using Chrome browser, but as ‘marbles’ when accessing the same page using Selenium?

Asked By: Hiram

||

Answers:

Observing the HTML DOM the only difference I can see is in the value of jsdata

With manual chrome browser:

jsdata="uqLsIf;_;$29"

manual_jsdata

While with Selenium driven ChromeDriver initiated Browsing Context:

jsdata="uqLsIf;_;$329"

ChromeDriver_jsdata


Deep Dive

Adapters allow JSData to connect to various datastores such as Firebase, MySql, RethinkDB, MongoDB, localStorage, Redis, a REST API, etc.

With the manual Chrome session you are logged in as a known user and using ChromeDriver it’s a brand new profile. Hence you get connect to different datastore and observe different results.

Answered By: undetected Selenium

Google translate has 2 service options – low quality and best quality.
For example, if you use python googletrans, you get access to google translate with lower quality.
You can get best quality when manually using a normal browser, or with google cloud user with official API to google translate (but this option includes paying).
With the unofficial API and selenium you will get lower quality.
How google knows that it’s selenium? The driver tells it

Answered By: lisrael1