# -*- coding: utf-8 -*-
from selenium import webdriver
from time import sleep


mobileEmulation = {'deviceName': 'Apple iPhone 4'}
options = webdriver.ChromeOptions()
options.add_experimental_option('mobileEmulation', mobileEmulation)

driver = webdriver.Chrome(executable_path='chromedriver.exe', chrome_options=options)

driver.get('http://m.baidu.com')

sleep(3)
driver.close()

  其中Apple iPhone 4为浏览器内支持的手机型号

相关文章:

  • 2022-12-23
  • 2021-09-25
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
猜你喜欢
  • 2022-01-17
  • 2021-04-01
  • 2022-12-23
  • 2021-06-07
  • 2021-06-07
  • 2022-12-23
相关资源
相似解决方案