场景:PC
工具:selenium + webdriver
元素调试:PC浏览器F12设置为手机模式
自动化:手机模式打开web页面
1、代码示例
# 在电脑上模拟手机模式页面只需要用到selenium和手机没有关系所以用不到appium。
from selenium import webdriver
ChromePath = r"D:\chromedriver\chromedriver_win32-V103.0.5060.53\chromedriver.exe"
# 配置浏览器以手机模式启动
chrome_options = webdriver.ChromeOptions()
# 选择存在的对应的手机模式,使用默认的devicesNam