brenden / node-webshot

Easy website screenshots in Node.js
2.12k stars 285 forks source link

why can not get images? #95

Closed xr closed 9 years ago

xr commented 9 years ago

here is the implementation using node-webshot

https://storyby.com/api/v1/assets/images?capture_url=https://storyby.com/topic/european-cities-use1-53e9e4d78617950c2b8598fc

it can not return the images on the page https://storyby.com/topic/european-cities-use1-53e9e4d78617950c2b8598fc

the implementation code is like:

var options = {
    streamType: 'jpeg',
    screenSize: {
      width: 900,
      height: 1200
    },
    shotSize: {
      width: 900,
      height: 800
    },
    userAgent: 'Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 ' +
               '(KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3',
    timeout: config.webshot.timeout,
    phantomConfig: {
      "ignore-ssl-errors": "true",
      "ssl-protocol": "any"
    },
    settings: {
      resourceTimeout: 60000
    },
    renderDelay: 4000
  }

I think maybe the renderDelay problems, but when I change to 15000, still can not take the pictures in, meanwhile, the pictures should download very fast, even 4 sec is enough. so is there any possible reasons?

lukepolo commented 9 years ago

This is fixed in PhantomJS 2 : screen shot 2015-03-20 at 10 34 28 pm