sheebz / phantom-proxy

a lightweight proxy that lets you to drive phantomjs from node.
MIT License
137 stars 33 forks source link

proxy.page.set dosen't work #50

Closed skotchio closed 11 years ago

skotchio commented 11 years ago

Here is the example:

var phantomProxy = require('phantom-proxy');

phantomProxy.create({}, function (proxy) {
   proxy.page.set('paperSize', {format: 'A4', orientation: 'landscape'}, function (result) {
     proxy.page.render('./test.png', function (result) {
         proxy.end(function () {console.log('done');});
     });
   });
});

At the end of story I get test.png file with the default 400x300 dimensions.

reverie commented 11 years ago

Contrary to the docs, I had to use page.set('settings, {..}) just to set the userAgent. Maybe the same thing will work for you.

reverie commented 11 years ago

Yes, try page.settings.set('paperSize', ...).

I'd also try removing any calls to page.get, as that was triggering a crash later on for me. (No idea why.)