brenden / node-webshot

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

Webshot takes picture of ad only on nytimes.com #68

Open sferoze opened 10 years ago

sferoze commented 10 years ago

Here is what I see when I go to nytimes.com in my browser:

screen shot 2014-07-04 at 3 17 34 pm

Here is what I see when I look at the screenshot webshot module takes of nytimes.com

nytimes-ad

Why is this happening, and can I fix this somehow?

LorenzGardner commented 10 years ago

what does your js look like?

I had the following simple one line and it worked for me

webshot('http://www.nytimes.com/', 'test.png');
rgbkrk commented 9 years ago

Looks like a sometimes ad banner that gets served every now and then on all these news sites. Are you able to select the "Skip this ad" bit using a callback in your options on page load:

var options = {
  onLoadFinished: function() {
      // Fancy code for detecting the ad, deleting it
    }
}

webshot('http://www.nytimes.com/', 'nytimes.png', options)
rgbkrk commented 9 years ago

Note that this is just how NY Times chooses to render content for you, based on your IP, User Agent, time of day, etc. This is not a node-webshot issue (or even a PhantomJS issue).