使用Splinter操纵浏览器(窗口)的大小 | BugJia

seofangfa 其他杂项评论92阅读模式
摘要我正在尝试使用Splinter的Firefox驱动程序来测试一些响应式设计.自然,这需要我调整浏览器窗口的大小.我根本找不到关于the documentation中调整浏览器大小的...

我正在尝试使用Splinter的Firefox驱动程序来测试一些响应式设计.自然,这需要我调整浏览器窗口的大小.我根本找不到关于the documentation中调整浏览器大小的任何信息.我怎样才能做到这一点?

from splinter import Browser
with Browser() as browser:
    # How do I set the browser size?

最佳答案

只是这样做:

browser.driver.set_window_size(640, 480)

文章末尾固定信息

weinxin
我的微信
我的微信
微信扫一扫
 
seofangfa
  • 本文由 seofangfa 发表于 2021年1月6日18:13:23
  • 转载请务必保留本文链接:https://wp.fangfa.me/other-note/%e4%bd%bf%e7%94%a8splinter%e6%93%8d%e7%ba%b5%e6%b5%8f%e8%a7%88%e5%99%a8%e7%aa%97%e5%8f%a3%e7%9a%84%e5%a4%a7%e5%b0%8f-bugjia.html
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
确定

拖动滑块以完成验证