zoukankan      html  css  js  c++  java
  • selenium 浏览器通过手机模式访问网页

    code

    from selenium import webdriver 
    
    mobileEmulation = {'deviceName' :'Galaxy S5'}
    option=webdriver.ChromeOptions()
    option.add_experimental_option('mobileEmulation',mobileEmulation)
    
    charome = webdriver.Chrome(options=option)
    charome.get("https://xxx.com/login")

     deviceName列表

    mobile_emulation = {
                "deviceName": "Apple iPhone 3GS",
                "deviceName": "Apple iPhone 4",
                "deviceName": "Apple iPhone 5",
                "deviceName": "Apple iPhone 6",
                "deviceName": "Apple iPhone 6 Plus",
                "deviceName": "BlackBerry Z10",
                "deviceName": "BlackBerry Z30",
                "deviceName": "Google Nexus 4",
                "deviceName": "Google Nexus 5",
                "deviceName": "Google Nexus S",
                "deviceName": "HTC Evo, Touch HD, Desire HD, Desire",
                "deviceName": "HTC One X, EVO LTE",
                "deviceName": "HTC Sensation, Evo 3D",
                "deviceName": "LG Optimus 2X, Optimus 3D, Optimus Black",
                "deviceName": "LG Optimus G",
                "deviceName": "LG Optimus LTE, Optimus 4X HD" ,
                "deviceName": "LG Optimus One",
                "deviceName": "Motorola Defy, Droid, Droid X, Milestone",
                "deviceName": "Motorola Droid 3, Droid 4, Droid Razr, Atrix 4G, Atrix 2",
                "deviceName": "Motorola Droid Razr HD",
                "deviceName": "Nokia C5, C6, C7, N97, N8, X7",
                "deviceName": "Nokia Lumia 7X0, Lumia 8XX, Lumia 900, N800, N810, N900",
                "deviceName": "Samsung Galaxy Note 3",
                "deviceName": "Samsung Galaxy Note II",
                "deviceName": "Samsung Galaxy Note",
                "deviceName": "Samsung Galaxy S III, Galaxy Nexus",
                "deviceName": "Samsung Galaxy S, S II, W",
                "deviceName": "Samsung Galaxy S4",
                "deviceName": "Sony Xperia S, Ion",
                "deviceName": "Sony Xperia Sola, U",
                "deviceName": "Sony Xperia Z, Z1",
                "deviceName": "Amazon Kindle Fire HDX 7″",
                "deviceName": "Amazon Kindle Fire HDX 8.9″",
                "deviceName": "Amazon Kindle Fire (First Generation)",
                "deviceName": "Apple iPad 1 / 2 / iPad Mini",
                "deviceName": "Apple iPad 3 / 4",
                "deviceName": "BlackBerry PlayBook",
                "deviceName": "Google Nexus 10",
                "deviceName": "Google Nexus 7 2",
                "deviceName": "Google Nexus 7",
                "deviceName": "Motorola Xoom, Xyboard",
                "deviceName": "Samsung Galaxy Tab 7.7, 8.9, 10.1",
                "deviceName": "Samsung Galaxy Tab",
                "deviceName": "Notebook with touch",
                "deviceName": "iPhone 6"
    }

  • 相关阅读:
    git命令
    基于babel实现react核心功能(初始化,fiber,hook)
    Vue组件化原理-Xmind版
    访问后台 出现 俩次请求拼接情况 例如 https://localhost:4431/api/auth/jwt/token+https://localhost:4431/api/auth/jwt/token
    spring mvc 拦截器和过滤器
    前后端分离,session登录实例,jquery版本必须大于1.5,否则withCredentials不起作用
    kafka batches 数据结构是自定义map
    数据库blob中文乱码,如何查看
    先更新数据库 后删缓存
    高老师好
  • 原文地址:https://www.cnblogs.com/sea-stream/p/14262272.html
Copyright © 2011-2022 走看看