0

I'm using Splinter (https://splinter.readthedocs.org) with PhantomJS driver, as useragent I use:

Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.3) Gecko/2008092814 (Debian-3.0.1-1)

In ghostdriver log file I can observe that the user agent is used by PhantomJS. Pages are rendered by the browser, but when taking screenshots of the different pages I browse, I can observe that they rendered for mobile devices and page items that are only shown in normal web version are not loaded.

When creating an instance of the Splinter Browser object is it necessary to specify a specific parameter to the PhantomJS webdriver?

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
martin
  • 53
  • 1
  • 1
  • 4

1 Answers1

0

You should set desktop resolution for PhantomJS. Based on another question on Splinter:

from splinter import Browser

with Browser() as browser:

    # Optional, but make sure large enough that responsive pages don't
    # hide elements on you...
    browser.driver.set_window_size(1280, 1024)
Community
  • 1
  • 1
Vaviloff
  • 16,282
  • 6
  • 48
  • 56