#coding = utf-8
from selenium import webdriver
'''打开PC浏览器,开发者模式下手机模式'''
mobile_emulation = {'deviceName': 'Galaxy S5'}# deviceName + 浏览器开发者模式下的手机名称
# mobile_emulation = {'deviceName': 'iPhone 6'}
# mobile_emulation = {'deviceName': 'Vivo X27'}
options = webdriver.ChromeOptions()
options.add_argument('lang=zh_CN.UTF-8')
options.add_experimental_option("mobileEmulation", mobile_emulation)
driver = webdriver.Chrome(options = options)
driver.get("http://www.baidu.com")
##############################################################################################
##############################################################################################
##############################################################################################
###########################################################################################
PC浏览器开发者模式手机模拟器demo和下载图片demo
最新推荐文章于 2024-06-22 01:21:08 发布
本文详细介绍了如何利用Python的Selenium库,在Chrome浏览器的开发者模式下模拟手机设备进行网页浏览。同时,还讲解了如何在模拟环境中下载网页上的图片,为自动化测试和数据抓取提供了实用技巧。
摘要由CSDN通过智能技术生成