Python で Web ページのスクリーンショットを取得したいと考えています。このために、私はhttp://github.com/AdamN/python-webkit2png/を使用しています。
newArgs = ["xvfb-run", "--server-args=-screen 0, 640x480x24", sys.argv[0]]
for i in range(1, len(sys.argv)):
if sys.argv[i] not in ["-x", "--xvfb"]:
newArgs.append(sys.argv[i])
logging.debug("Executing %s" % " ".join(newArgs))
os.execvp(newArgs[0], newArgs)
基本的に、正しい引数で xvfb-run を呼び出します。しかし、次のman xvfb
ように述べています。
Note that the demo X clients used in the above examples will not exit on their own, so they will have to be killed before xvfb-run will exit.
つまり、このスクリプト全体がループ内にある場合 (複数のスクリーンショットを取得するため)、X サーバーが強制終了されない限り、このスクリプトは <????> を実行します。どうやってやるの?