How do I, using Selenium (Python), change the UAS (User Agent String) on a webdriver.Chrome() Instance?
I do automated tests, and use more than just Firefox. With firefox my quest is simple, but to get the same result on Chrome, i am at a loss.
How do I, using Selenium (Python), change the UAS (User Agent String) on a webdriver.Chrome() Instance?
I do automated tests, and use more than just Firefox. With firefox my quest is simple, but to get the same result on Chrome, i am at a loss.
It may be possible to change the UAS using ChromeOptions
for your chrome implementation. As referenced from this example of chrome options, and this example of implementing a UAS in chrome (granted it is in C#):
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--user-agent=" + givenUAS)
driver = webdriver.Chrome(chrome_options=chrome_options)
I hope this helps.