I'm trying to figure out a way whereby whenever I open up Chrome via Selenium (in Python) in this particular script, the Chrome page automatically opens up with another user agent selected - in this case, Microsoft Edge Mobile (but I will be accessing it from the desktop).
So, after doing some research, I've been able to piece together the following code, which I thought would execute a user-agent switch in Chrome and then open up a new Bing.com page:
from selenium import webdriver
from selenium.webdriver.chrome.options
import Options opts = Options()
opts.add_argument("user-agent=Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 640 XL LTE) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Edge/12.10166")
driver = webdriver.Chrome(chrome_options=opts)
driver = webdriver.Chrome("D:\_")
driver.get("https://www.bing.com/")
However, the code doesn't seem to be working and stops before opening up the designated webpage. I'm fairly certain the first half of code is off, but I'm not quite sure how. Any and all help would be deeply appreciated.