I am attempting to change my user agent and print the changed user agent to the terminal to check whether it has been successfully changed however I am having no luck.
I am using selenium wire and attempting to change it so i can login to a mobile version of the website. I cant put in the user agent i want due to security reasons however i have been at it for days and have no luck.
Please see my code below
driver = webdriver.Chrome('/Users/callum/Desktop/chromedriver')
def interceptor(request):
del request.headers['User-Agent'] request.headers['User-Agent'] = '####'
driver.get("https://www.google.com")
I also cannot print the user agent from selenium wire, i can only do it using this method.
agent = driver.execute_script("return navigator.userAgent")
print(agent)
Can someone please assist, it would be much appreciated :)