2

Is there any way of capturing web screnshot in the way that the output will look like the way a website would look using a mobile device, such an iphone? Iv'e tried using an iphone user-agent, and to use the exact same resolution, but the result is not the same.

Im trying to render a simple page using this html:

<html>
<head>...</head>
<body>
<img src="..." style="400px;height:300px" />
</body>

I know that this code is not responsive. though I would expect phantomjs to render it the way the device renders it.

Thanks

superuser123
  • 955
  • 2
  • 12
  • 24
  • What's different about it? – Rob Campion Jun 12 '15 at 14:14
  • @RobCampo I'm also trying to do this. The one thing that sticks out for me is if there are overflow areas the screenshots will show a browser-style scrollbar and not the mobile hidden-style ones. I guess I can do overflow:hidden to get around this but I wish there was an native PhantomJS way. Changing User Agent doesn't help – Francisc0 Apr 12 '16 at 20:14
  • @Francisc0 make sure both `viewportSize` and `clipRect` are set: http://phantomjs.org/screen-capture.html – Rob Campion Apr 13 '16 at 10:23

0 Answers0