1 from selenium import webdriver 2 mobile_emulation = {'deviceName':'iPhone X'} 3 options = webdriver.ChromeOptions() 4 options.add_experimental_option('mobileEmulation',mobile_emulation) 5 drivers = webdriver.Chrome(chrome_options=options) 6 drivers.maximize_window() 7 drivers.get("http://www.baidu.com")