F
F
Firues2017-09-26 15:37:49
Python
Firues, 2017-09-26 15:37:49

How to change screen resolution in PhantomJS?

I can not google the question regarding changing the screen resolution.
There will always be 1024x768.
Changing the viewportSize does not change the screen resolution, of course.
I checked the resolution here: ( link )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
planc, 2017-09-26
@planc

they check screen resolution, while responsive design needs window size

from selenium import webdriver


driver = webdriver.PhantomJS()
print (driver.get_window_size())
driver.get("https://toster.ru")
driver.save_screenshot("screenshot1.png")
driver.set_window_size(1920, 1080)
print (driver.get_window_size())
driver.get("https://toster.ru")
driver.save_screenshot("screenshot2.png")
driver.close()

spoiler
2f488ee0338afe664b6237c79421a304e32b0308ba96424adb0b30ceef646e4edc8990700aefd39d

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question