是否可以使用Python在Selenium上设置自定义桌面分辨率?
我可以使用 python 设置自定义窗口大小,但无论如何都可以检测我的桌面分辨率。我需要更改 screenResolution = 1920,1080 可用屏幕分辨率 = 1920,1032,带硒铬。是否可以?
I can set custom window size with python, but can detect my desktop resolution anyway. I need to change screenResolution = 1920,1080
availableScreenResolution = 1920,1032 with selenium chrome. Is it possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从屏幕对象检索屏幕分辨率。如果您输入控制台和类型屏幕,您将看到值和属性。
您可以执行JavaScript以更改OBEJCT的值,因此
问题是此对象刷新位置的每次更改,因此您可能需要一个扩展程序,每次浏览器进行浏览器进行申请编辑时都
可以执行此操作,您可以使用事件处理程序来触发它,每次触发它您导航的时间
触发python事件由Selenium Controlded Browser驱动的事件
Screen resolution is retrieved from the screen object. If you enter the console and type screen you will see the values and properties.
You can execute javascript to change the obejct's values like this
The problem is this object refreshes with every change of location so you'd probably need an extension that executes this every time the browser makes a request
EDIT you can use event handlers to trigger it every time you navigate
trigger python events driven by selenium controlled browser