fromseleniumimportwebdrivermobileEmulation{deviceName:GalaxyS5}opt from selenium import webdrivermobileEmulation = {'deviceName' :'Galaxy S5'}option = webdriver.ChromeOptions()option.add_experimental_option('mobileEmulation',mobileEmulatio
from selenium import webdrivermobileEmulation = {'deviceName' :'Galaxy S5'}option = webdriver.ChromeOptions()option.add_experimental_option('mobileEmulation',mobileEmulation)charome = webdriver.Chrome(optiOns=option)
网上找到的都是这种方式,但这种方法有些弊端,这个没有真正进入toggle device toolbar模式,导致后续有些操作无法实现。目前还没找到方法去:模拟打开开发者模式,再点击oggle device toolbar模式这个过程