标签:visible 4.0 .com 使用 title bdr ble exec 火狐浏览器
sudo apt-get install python-pip
sudo apt-get install xvfb xserver-xephyr vnc4server
sudo pip install pyvirtualdisplay
# 可选
sudo apt-get install python-pil scrot
sudo pip install pyscreenshot
# optional for examples
sudo pip install entrypoint2
测试程序
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(800, 600))
display.start()
browser = webdriver.Firefox(executable_path=r‘/usr/bin/firefox‘)
browser.get(‘https://www.baidu.com‘)
print browser.title
browser.quit()
display.stop()
输出
百度一下,你就知道
PyVirtualDisplay官方文档https://pypi.python.org/pypi/PyVirtualDisplay
标签:visible 4.0 .com 使用 title bdr ble exec 火狐浏览器
原文地址:http://www.cnblogs.com/lgh344902118/p/6269171.html