I'm trying to change "accept-language" header for selenium bot. As i find out there are 2 opportunities to do this: https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setUserAgentOverride and https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setUserAgentOverride . The question is what the difference between this methods. Thank you for your answers.
Asked
Active
Viewed 699 times
1
-
https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setUserAgentOverride also has acceptLanguage. As far as I can tell, both APIs are identical. What's interesting is the optional parameter, userAgentMetadata, in Network.setUserAgentOverride references the Emulation.UserAgentMetadata as it's type. – tkm Oct 21 '22 at 20:19
1 Answers
0
If you are specifically trying to change the accept-language
header then you have to use Emulation.setUserAgentOverride.
Emulation.setUserAgentOverride: Allows overriding user agent with the given string.
PARAMETERS
userAgent(string): User agent to use.
acceptLanguage(string): Browser langugage to emulate.
platform(string): The platform navigator.platform should return.

undetected Selenium
- 183,867
- 41
- 278
- 352