NewDreamTester 发表于 2018-7-16 14:21:25

selenium+python 用手机模式打开浏览器

from selenium import webdriver
mobile_emulation = {'deviceName': 'iPhone 6'}
options = webdriver.ChromeOptions()
options.add_experimental_option("mobileEmulation", mobile_emulation)
browser = webdriver.Chrome(executable_path='chromedriver.exe', chrome_options=options)
browser.get("http://www.baidu.com")
browser.implicitly_wait(2)

ldorothy 发表于 2018-7-17 11:42:26

今天用了下,真的很棒:victory::victory:
页: [1]
查看完整版本: selenium+python 用手机模式打开浏览器