【问题标题】:Using child gnome-terminal for running Xvfb使用子 gnome-terminal 运行 Xvfb
【发布时间】:2016-02-27 10:02:15
【问题描述】:

我想运行一个 bash 脚本中的 python 脚本。 Python 脚本使用 selenium Web 驱动程序,因此为了将 firefox 用作无头浏览器,我需要先安装 Xvfb。我想在另一个终端上安装 Xvfb,比如安装 Xvfb 然后启动 Xvfb 的弹出窗口。

#!/bin/bash
gnome-terminal -e "bash -c \"sudo apt-get install Xvfb; Xvfb :99 -ac; export DISPLAY=:99; exec bash\"" 
echo -e "\n-----Welcome to automation script-----\n"
echo -n "Enter username : "
read username

我希望 Xvfb 继续运行,如图所示。

我想重新关注父终端。或者我可以安装然后启动 xvfb 并继续执行我的脚本的任何其他解决方案。我该怎么做?

【问题讨论】:

    标签: python bash selenium terminal


    【解决方案1】:

    尝试xvfb-run 在 Xvfb 环境中运行您的命令。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-11
      • 2015-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多