Answer the question
In order to leave comments, you need to log in
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
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()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question