I'm building a search bot and i want it to change from Desktop to Mobile
I tried to use profile.set_preferences but for some reason it wont change. It doesn't give compiling time error but it wont change the user agent. I also tried setting the desired capabilities but that didn't work either.
if count == 0:
browser = webdriver.Firefox(executable_path="geckodriver.exe")
else:
profile = webdriver.FirefoxProfile()
profile.set_preference("general.useragent.override", "Mozilla/5.0 (Android 4.4; Tablet; rv:41.0) Gecko/41.0 Firefox/41.0")
browser = webdriver.Firefox(profile)
I want it to search once as a regular browser and then to search as a mobile device but it just searches as a regular browser both times and i am sure that i increment count.