I am trying to run chrome in headless mode on a remote EC2 server running on Ubuntu. I recently did package upgrades
- Google Chrome 83.0.4103.97
- ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416})
- PyVirtualDisplay==1.3.2
- selenium==3.141.0
Previously I was using an older version of google-chrome, chromedriver, and pyvirtualdisplay. I was able to set the display size Display(visible=0, size=(1400, 1800))
and I could view the entire webpage but after the upgrade, I am no longer to adjust the screen via the size
argument for the Display
object. I end up having to do the following:
from selenium import webdriver
from pyvirtualdisplay import Display
display = Display(visible=0, size=(1400, 1800))
display.start()
url='somewebsite.com'
driver.get(url)
driver.set_window_size(1400, 1800)
So my question is, what is even the point of intializing my Display object with Display(visible=0, size=(1400, 1800))
?