Selenium 用chrome的Mobile emulation模拟手机

device name确定手机样式

  from selenium import webdriver
  from time import sleep

  mobileEmulation = {‘deviceName‘: ‘iPhone 6/7/8 Plus‘}
  options = webdriver.ChromeOptions()
  options.add_experimental_option(‘mobileEmulation‘, mobileEmulation)
  mobile_driver = webdriver.Chrome(executable_path=‘chromedriver.exe‘, chrome_options=options)
  mobile_driver.get(‘http://m.baidu.com‘)
  print(‘iphone_mobile_driver‘)
  sleep(3)
  mobile_driver.close()

Selenium 用chrome的Mobile emulation模拟手机

上一篇:Idea 关于SpringBoot的@AutoWired 注入问题--无法自动装配Could not autowire. No beans of 'UserMapper' type found. more...


下一篇:《APP》团队冲刺第二阶段 三