seleniumbase / SeleniumBase

📊 Blazing fast Python framework for web crawling, scraping, testing, and reporting. Supports pytest. Stealth abilities: UC Mode and CDP Mode.
https://seleniumbase.io
MIT License
5.44k stars 983 forks source link

locale_code should set lang instead of just intl.accept_languages #3212

Closed jimmy927 closed 1 month ago

jimmy927 commented 1 month ago

locale_code should set lang instead of just intl.accept_languages

mdmintz commented 1 month ago

Both https://stackoverflow.com/a/11375463/7058266 and https://stackoverflow.com/a/55254431/7058266 say that using intl.accept_languages is the correct way to do it. I see no effect with the --lang arg. Can you show me a full example where adding the arg changed website behavior with SeleniumBase?

jimmy927 commented 1 month ago

Both https://stackoverflow.com/a/11375463/7058266 and https://stackoverflow.com/a/55254431/7058266 say that using intl.accept_languages is the correct way to do it. I see no effect with the --lang arg. Can you show me a full example where adding the arg changed website behavior with SeleniumBase?

My code:

Driver(lang="en_us")

With my patch i get english, without my patch i get swedish (which is the locale of the local windows) Maybe this is different on different os ?

Chrome 130, Windows 10

mdmintz commented 1 month ago

I need to see a full example script, with a real website. Not partial code.

jimmy927 commented 1 month ago

sorry, no time. Just throw it away if you like.