pyvirtualdisplay

PythonAnywhere - No module named 'pyvirtualdisplay'

£可爱£侵袭症+ 提交于 2020-01-15 10:23:09
问题 I am trying to run online a project on PythonAnywhere. When I call this function: def getPrice(item_url): from forex_python.converter import CurrencyRates from selenium import webdriver from pyvirtualdisplay import Display #from IPython.display import display with Display(): browser = webdriver.Firefox() try: browser.get(item_url) item_price = browser.find_element_by_xpath("//SPAN[@class='market_table_value normal_price']").text #item_price isn't an integer, it's a string, 'Prezzo iniziale: $

I have the problem with PyVirtualDisplay==0.2.5 package for running tests with usage of virtual displays (headless mode)

狂风中的少年 提交于 2020-01-15 09:36:07
问题 My tests are working and running as expected with PyVirtualDisplay==0.2.1 , but I have a problem with the latest version of this package (for example, PyVirtualDisplay==0.2.5 ). My code snippet: ... def _set_up(self): # Creation of instance of the browser. self.display = Display(visible=0, size=(config.WIDTH, config.HEIGHT)) self.display.start() desired = self.get_desired_capabilities(config.BROWSER) self.driver = webdriver.Remote(command_executor=config.ACTIVE_NODE, desired_capabilities

How to video-record selenium tests running headless inside a docker?

拈花ヽ惹草 提交于 2020-01-12 14:01:51
问题 I am running python-selenium tests inside a docker using a headless firefox. During these tests I am able to make screenshots with the selenium method for screenshots - but can I use something to 'video' record the virtual display during the whole test (several test scripts with several test methods, with many webdrivers started and stopped). So how can I video-record a complete test session? Addendum : I have found a webpage that describes exactly what I need: here. Unfortunately I get an

Selenium Pyvirtualdisplay Hangs on starting

匆匆过客 提交于 2020-01-01 05:11:06
问题 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

Is there a Windows equivalent to PyVirtualDisplay

筅森魡賤 提交于 2019-12-30 08:08:49
问题 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? 回答1: 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

Headless script crashes after a few runs

自闭症网瘾萝莉.ら 提交于 2019-12-23 07:42:50
问题 I have a script using a headless browser which I'm running using crontab -e . It runs fine the first few times and then crashes with the following Traceback: Traceback (most recent call last): File "/home/clint-selenium-firefox.py", line 83, in <module> driver.get(url) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 248, in get self.execute(Command.GET, {'url': url}) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py"

How to attach pyautogui to the virtual display?

丶灬走出姿态 提交于 2019-12-23 05:01:29
问题 How do I attach pyautogui to the display in multithreaded mode? In the example of my code, pyautogui always has access to the upper display. Is it possible to have pyautogui control on each display? import os from selenium import webdriver from pyvirtualdisplay import Display import Xlib.display # ... # let's say i run this function in two threads def do_work(data): v_display = Display(visible=0, size=(900, 600)) v_display.start() # How can i attach v_display to the pyautogui? import

How I can attach the mouse movement (pyautogui) to pyvirtualdisplay with selenium webdriver (python)?

不打扰是莪最后的温柔 提交于 2019-12-20 14:24:03
问题 I am trying to automatize a website how have a SWF inside. I cant move the mouse with selenium, because is a SWF,so to fix this I use the pyautogui library. Everything works fine!, but! when I use pyvirtualdisplay to hide the navigator the mouse is not attached, so I still see how pyautogui move my mouse. My example code: from selenium import webdriver from pyvirtualdisplay import Display import pyautogui display = Display(visible=1, size=(1600,900)) display.start() driver = webdriver.Firefox

Firefox started by Selenium ignores the display created by pyvirtualdisplay

时光毁灭记忆、已成空白 提交于 2019-12-18 05:21:38
问题 I start a display with pyvirtualdisplay before creating my WebDriver instance. If I use Chrome, it works without any problem: Chrome shows up in the Xephyr instance that pyvirtualdisplay creates. However, when I use Firefox, the Xephyr instance appears but Firefox shows up outside of it. Here is code that fully reproduces the problem: from selenium import webdriver from selenium.webdriver.firefox.webdriver import FirefoxBinary import pyvirtualdisplay binary = FirefoxBinary() with

Python XVFB error in windows

不羁的心 提交于 2019-12-04 01:24:00
问题 For virtual Framebuffer (headless testing) I'm using Xvfb with PyVirtualDisplay and it's working fine in Ubuntu but showing error in Windows7. here is part of code where problem is occurring. from pyvirtualdisplay import Display display = Display(visible=1, size=(300, 400)) display.start() but when I run same command in Windows, I get this error Traceback (most recent call last): File "C:\Python27\Scripts\pynt-script.py", line 9, in <module> load_entry_point('pynt==0.8.0', 'console_scripts',