V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
gimp
V2EX  ›  Python

请问如何在 selenium webdriver 启动的时候自动进入火狐的响应式界面,并且开启触摸事件?

  •  
  •   gimp · 2016-05-07 22:32:31 +08:00 via Android · 2945 次点击
    这是一个创建于 2921 天前的主题,其中的信息可能已经有所发展或是发生改变。
    是这样的,我想用 python 和 selenium 抓取一个 app 中的网页,这个网页在火狐开启响应式布局界面并且点击加载触摸事件后才会展示数据

    chrome 的话进入响应式布局就可以显示数据

    我搜了一会,没找到解决办法

    请问关于 selenium 的手机端测试有什么比较不错的资料吗,或者如何才能让 selenium driver 启动的时候就进去响应式布局并且开启触摸事件,谢啦
    3 条回复    2016-05-08 11:43:05 +08:00
    sfree2005
        1
    sfree2005  
       2016-05-07 23:51:47 +08:00 via Android
    pc10201
        2
    pc10201  
       2016-05-07 23:53:23 +08:00
    很简单,可以自定义 firefox 或 chrome 的 user-agent ,改为移动端的就行了
    chunqiuyiyu
        3
    chunqiuyiyu  
       2016-05-08 11:43:05 +08:00 via Android
    二楼正解,可以看看这篇文章, http://www.chunqiuyiyu.com/2016/01/learn-splinter.html
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   949 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:38 · PVG 05:38 · LAX 14:38 · JFK 17:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.