测试积点老人 发表于 2019-1-4 15:41:29

selenium 服务器使用selenium

安装 xvfb
sudo apt install xvfb
安装 pyvirtualdisplay
sudo pip install pyvirtualdisplay
安装 chrome, chromedriverhttps://sites.google.com/a/chromium.org/chromedriver/downloads
用法import time
from pyvirtualdisplay import Display
from selenium import webdriver

url = "http://www.163.com"
with Display(backend="xvfb", size=(1024, 768)):
    driver = webdriver.Chrome()
    driver.maximize_window()
    driver.get(url)
    driver.quit()

页: [1]
查看完整版本: selenium 服务器使用selenium