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

其他杂项23字数 227阅读0分45秒阅读模式

我正在尝试使用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)

 
  • 本文由 asdfasd 发表于 2025-02-1314:06:57
  • 转载请务必保留本文链接:http://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-2.html