seleniumbase / SeleniumBase

📊 Python's all-in-one framework for web crawling, scraping, testing, and reporting. Supports pytest. UC Mode provides stealth. Includes many tools.
https://seleniumbase.io
MIT License
5.33k stars 980 forks source link

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

Closed jimmy927 closed 1 week ago

jimmy927 commented 1 week ago

locale_code should set lang instead of just intl.accept_languages

mdmintz commented 1 week 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 week 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 week ago

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

jimmy927 commented 1 week ago

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