硒需要显示器吗 [英] Does Selenium need display monitor

查看:61
本文介绍了硒需要显示器吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Selenium打开一个网站,登录并从一个网站复制一些信息.但是,这是在我的工作站上发生的,并有一个显示器.

I am using Selenium to open a web site, login and copy some information from one web site. However it is happening on my work station and have a display monitor.

我的IT团队希望将此过程转移到没有监视器的虚拟服务器上.

my IT team wants to move this process to a virtual server which does not have a monitor.

1.即使我们在服务器上安装了Firefox的Chrome浏览器,这项工作也可以吗?2.我们可以Chrome吗?3.任何其他方式-我们可以考虑使用Xserver

1.Will this work - even if we install Chrome of Firefox on the server 2. Can we Chrome - headless to make this happen 3. Any other way - we can think of using Xserver

请让我知道.

推荐答案

Chromeless head应该可以在这里解决您的问题-过去,我已经实现了一些自动化,并且取得了成功.

Chrome headless should solve your problem here -- I've done this in the past with some of my automation and had success.

只需记住使用 ChromeOptions 添加-headless 标志.您可能还需要调整其他 ChromeOptions -我还必须添加-disable-gpu -window-size = 1920,1200 使我的工作正常进行.

Just remember to use ChromeOptions to add the --headless flag. You may need to tweak some other ChromeOptions as well -- I also had to add --disable-gpu and --window-size=1920,1200 to get mine working just right.

这篇关于硒需要显示器吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆