pyvirtualdisplay

Selenium Pyvirtualdisplay Hangs on starting

我只是一个虾纸丫 提交于 2019-12-03 14:38:46
I have a selenium test which I am trying to run Headlessly on my ubuntu server. It uses pyvirtualdisplay and xephyr. Though the script is running fine in my local system, it hangs when I run it in the server. I have tried to clear memory and restarting the server. But no luck. The script looks something like this : from selenium import webdriver from pyvirtualdisplay import Display display = Display(visible=0, size=(1366, 768)) display.start() driver = webdriver.Firefox() driver.set_window_size(1366, 768) driver.get ("http://www.google.com/") Any help? Okay, finally I got through it. sudo apt

python - sending selenium chrome instance to the background

限于喜欢 提交于 2019-12-02 09:45:36
问题 I am trying to open a simple chrome instance using Python and selenium. Please find my code below: import time, datetime, sys, os start_time = time.time() from datetime import datetime os.system("cls") from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by

Is there a Windows equivalent to PyVirtualDisplay

霸气de小男生 提交于 2019-12-01 03:32:10
I have written a web scraper for a mate to save him time at work. It is written in Python , using Selenium and opening a Firefox browser. I have written this code myself on a Linux machine I use PyVirtualDisplay so Firefox doesn't actually open and disturb my work. How can I make it run within a virtual display on a Windows PC? The reason you can not run PyVirtualDisplay on Windows is that PyVirtualDisplay uses Xvfb as it's display and Xvfb is a headless display server for the X Window System, Windows does not use the X Window System. not recommended So... what you can do if you insist on

easyprocess.EasyProcessCheckInstalledError: cmd=['Xvfb', '-help'] OSError=[Errno 2] No such file or directory

混江龙づ霸主 提交于 2019-11-30 17:06:04
I'm trying to setup a display but it's telling me No such file or directory . Traceback (most recent call last): File "/var/www/envs/venv/proj/scripts/my_file.py", line 44, in click display = Display(visible=0, size=(800,600)) File "/usr/lib/python2.6/site-packages/pyvirtualdisplay/display.py", line 33, in __init__ self._obj = self.display_class( File "/usr/lib/python2.6/site-packages/pyvirtualdisplay/display.py", line 51, in display_class cls.check_installed() File "/usr/lib/python2.6/site-packages/pyvirtualdisplay/xvfb.py", line 38, in check_installed ubuntu_package=PACKAGE).check_installed(

easyprocess.EasyProcessCheckInstalledError: cmd=['Xvfb', '-help'] OSError=[Errno 2] No such file or directory

霸气de小男生 提交于 2019-11-30 01:10:36
问题 I'm trying to setup a display but it's telling me No such file or directory . Traceback (most recent call last): File "/var/www/envs/venv/proj/scripts/my_file.py", line 44, in click display = Display(visible=0, size=(800,600)) File "/usr/lib/python2.6/site-packages/pyvirtualdisplay/display.py", line 33, in __init__ self._obj = self.display_class( File "/usr/lib/python2.6/site-packages/pyvirtualdisplay/display.py", line 51, in display_class cls.check_installed() File "/usr/lib/python2.6/site

Selenium with pyvirtualdisplay unable to locate element

拜拜、爱过 提交于 2019-11-28 11:30:56
I have a working script that logs into a site using selenium like this: script.py from pyvirtualdisplay import Display from selenium import webdriver display = Display(visible=0, size=(1024, 768)) display.start() browser = webdriver.Firefox() actions = webdriver.ActionChains(browser) browser.get('some_url_I_need') content = browser.find_element_by_id('content') # Error on this line running that script on an amazon ubuntu box through ssh where I installed firefox the following way: sudo apt-get install firefox The error I get is: selenium.common.exceptions.NoSuchElementException: Message: u

Selenium with pyvirtualdisplay unable to locate element

↘锁芯ラ 提交于 2019-11-27 06:14:29
问题 I have a working script that logs into a site using selenium like this: script.py from pyvirtualdisplay import Display from selenium import webdriver display = Display(visible=0, size=(1024, 768)) display.start() browser = webdriver.Firefox() actions = webdriver.ActionChains(browser) browser.get('some_url_I_need') content = browser.find_element_by_id('content') # Error on this line running that script on an amazon ubuntu box through ssh where I installed firefox the following way: sudo apt