1

Why is not the useragent the same in both cases?

https://www.whatsmyua.info/ reports the following when I browse with usual Firefox:

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0

However, browsing with geckodriver reports:

Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0

Here's how I start browsing with geckodriver:

options=Options()
profile_path = '/home/myuser/.mozilla/firefox/x9zoqd7t.default-release/'
options.set_preference('profile', profile_path)
service = Service('/usr/local/bin/geckodriver')
driver = Firefox(service=service, options=options)
driver.get("http://www.whatsmyua.info/")
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Rimfire
  • 378
  • 1
  • 3
  • 12

1 Answers1

0

Manually accessing Firefox v97.0 and accessing Selenium driven GeckoDriver v0.30.0 initiated Browsing Context, either way I see the same User Agent as follows:

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0

The most probhable reason for the mismatch is, you have 2 instances of Firefox browser installed.

The instance which you are accessing manually haven't been updated since it's previous version of 96.0, where as the instance installed at the location /home/myuser/.mozilla/firefox/ haven't been updated since 91.0. Hence you observe the difference in the useragent

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Your are right, I found another version installed! Btw, geckodriver doesn't present itself as headless or bot in the useragent. Is that normal? – Rimfire Feb 10 '22 at 14:43
  • @Rimfire I haven't looked into the specifics whether _geckodriver doesn't present itself as headless or bot in the useragent_. If you have a specific question feel free to raise it, I'd like to dig deeper to help you out. – undetected Selenium Feb 10 '22 at 15:05