标签:inf ble rom pyse phone option size window isa
以 Chrome 为例,通过设置 chromeoption 的参数即可实现启动浏览器后,开启手机模式。相应设置的源代码如下所示:
1 chromeOptions = webdriver.ChromeOptions() 2 chromeOptions.add_argument("disable-infobars") 3 4 mobile_emulation = {"deviceName":"iPhone X"} 5 chromeOptions.add_experimental_option("mobileEmulation", mobile_emulation) 6 7 browser = webdriver.Chrome(chrome_options=chromeOptions) 8 browser.set_window_size(400, 900)
通过设置 deviceName 可设置不同的手机类型。
标签:inf ble rom pyse phone option size window isa
原文地址:https://www.cnblogs.com/fengpingfan/p/10694670.html