How to fake the screen resolution for urllib.request.urlopen requests?

Viewed 398

I noticed, that when I access web pages via the urllib library, I get different source code compared to accessing the same page with a standard web browser. Especially some image links point to lower resolution versions of the image.

If this is related to the detected screen resolution when loading a web page, is there a way to fake it when loading with urllib.request.urlopen? If one provides a Request object, one can spoof some header information, is there something similar for the screen resolution? Is it possible to fill the javascript variable screen with some information by hand?

I know there exist some third party libraries like "Selenium WebDriver" and the like, but I want to use only the standard library.

0 Answers
Related