0

Is there a way to change User Agent when the selenium driver is already opened and running without quitting it ? When I'm opening a new tab I want it to use a new User Agent. I know to do it with the chrome options but you can't change them when the program already ran

options = Options()

options.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 = driver.Chrome(chrome_options=options)
  • 2
    No, is not posible to change options or arguments on Selenium Chrom. My solution is destroy and init it again, to change Proxy for example or to use other User-Agent – Wonka Jan 14 '20 at 17:53
  • Yes, take a look at [this answer](https://stackoverflow.com/questions/53161173/how-to-rotate-various-user-agents-using-selenium-python-on-each-request/59743954#59743954) – pguardiario Jan 15 '20 at 01:18

0 Answers0