set resolution for phantom/headless driver

This commit is contained in:
Mathew Guest 2020-02-23 03:48:38 -07:00
parent d028dea189
commit 359eb96f21

@ -316,12 +316,12 @@ class BrowserProxy:
def _create_driver_phantomjs(self): def _create_driver_phantomjs(self):
# Note(MG): Selenium support for PhantomJS has been deprecated, please use headless # Note(MG): Selenium support for PhantomJS has been deprecated, please use headless
# driver = selenium.webdriver.PhantomJS() # driver = selenium.webdriver.PhantomJS()
# driver.set_window_size(1280, 960)
# return driver # return driver
opt = selenium.webdriver.chrome.options.Options() opt = selenium.webdriver.chrome.options.Options()
opt.add_argument("--user-agent=" + USER_AGENT) opt.add_argument("--user-agent=" + USER_AGENT)
opt.add_argument("--kiosk-printing") opt.add_argument("--kiosk-printing")
opt.add_argument("--headless") opt.add_argument("--headless")
driver.set_window_size(838, 907)
driver = selenium.webdriver.Chrome(chrome_options = opt) driver = selenium.webdriver.Chrome(chrome_options = opt)
self.driver = driver self.driver = driver
return driver return driver