Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapping process not completing #186

Closed
aman4you opened this issue Oct 16, 2014 · 12 comments
Closed

Snapping process not completing #186

aman4you opened this issue Oct 16, 2014 · 12 comments

Comments

@aman4you
Copy link

Running rubyinstaller-2.1.3, ImageMagick-6.8.9-8-Q16-x86-static and phantomjs-1.9.7-windows

Snapping process not completing when running command "wraith capture config_hcl"

config_hcl.yaml file

browser:
phantomjs: "phantomjs"

snap_file: "javascript/snap_hcl.js"

directory: 'shots2'

domains:
dev: "http://hcldev.prod.acquia-sites.com"
live: "http://www.hcltech.com"

screen_widths:

  • 600
  • 1024

paths:
Page1: /careers/explore-hcl
Page2: /financial-services
page3: /i-have-an-idea/straighttalk
page4: /servers-and-storage
page5: /i-have-an-idea/hcl-global-meet
page6: /grassroot-innovations
page7: /consumer-electronics
page8: /geo-presence/united-states

fuzz: '20%'

spider_days:

  • 10

snap_hcl.js file

var system = require('system');
var page = require('webpage').create();
var fs = require('fs');

if (system.args.length === 3) {
console.log('Usage: snap.js ');
phantom.exit();
}

var url = system.args[1];
var image_name = system.args[3];
var view_port_width = system.args[2];

page.viewportSize = { width: view_port_width, height: 1500};
page.settings = { loadImages: true, javascriptEnabled: true };

page.settings.userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.17';

page.open(url, function(status) {
if(status == 'success') {
window.setTimeout(function() {
console.log('Snapping ' + url + ' at width ' + view_port_width);
page.render(image_name);
phantom.exit();
}, 5000);
} else {
console.log('Error with page ' + url);
phantom.exit();
}
});

@dblooman
Copy link
Contributor

What is the error message you are seeing in cmd prompt

@aman4you
Copy link
Author

After some snapshot, snapping process stop. there is no error message in cmd prompt

@aman4you
Copy link
Author

When snapping process not completing than i have to use ctrl + c command for try again.

@dblooman
Copy link
Contributor

Hi,

I tried your config,

#Headless browser option
browser:
  phantomjs: "phantomjs"

#If you want to have multiple snapping files, set the file name here
snap_file: "javascript/snap.js"

# Type the name of the directory that shots will be stored in
directory: 'shots'

# Add only 2 domains, key will act as a label
domains:
  dev: "http://hcldev.prod.acquia-sites.com"
  live: "http://www.hcltech.com"

#Type screen widths below, here are a couple of examples
screen_widths:
  - 600
  - 1024

#Type page URL paths below, here are a couple of examples
paths:
  Page1: /careers/explore-hcl
  Page2: /financial-services
  page3: /i-have-an-idea/straighttalk
  page4: /servers-and-storage
  page5: /i-have-an-idea/hcl-global-meet
  page6: /grassroot-innovations
  page7: /consumer-electronics
  page8: /geo-presence/united-states

#Amount of fuzz ImageMagick will use
fuzz: '20%'

mode: diffs_first

and JS file

var system = require('system');
var page = require('webpage').create();
var fs = require('fs');

if (system.args.length === 3) {
console.log('Usage: snap.js ');
phantom.exit();
}

var url = system.args[1];
var image_name = system.args[3];
var view_port_width = system.args[2];

page.viewportSize = { width: view_port_width, height: 1500};
page.settings = { loadImages: true, javascriptEnabled: true };

page.settings.userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.17';

page.open(url, function(status) {
  if(status == 'success') {
    window.setTimeout(function() {
      console.log('Snapping ' + url + ' at width ' + view_port_width);
      page.render(image_name);
      phantom.exit();
      }, 5000);
  } else {
    console.log('Error with page ' + url);
    phantom.exit();
  }
});

It's possible there are some spaces or format issues with your files, could you try copy and paste mine and see if they work.

@aman4you
Copy link
Author

Thanks for reply. I tried the above code but still snapping process not finishing. I think may be these problem occur because of parallel execution of snapshot. How to take one snapshot at one time.

@dblooman
Copy link
Contributor

Could you confirm you have imagemagick installed

@aman4you
Copy link
Author

aman4you commented Nov 5, 2014

yes, imagemagick is installed.

If i run command "wraith capture config" for some url's like 3 and at screen width like 1024 then snapping process is completing. If i increase the number of url's like 10 and at screen width like 1024, 600 and 300 then snapping process is not completing.

@Qlczas
Copy link

Qlczas commented Jul 25, 2016

Hi, I have same problem as described above.
My config:
Windows 8 Lenovo W540 laptop, PhantomJS 1.9.8. Wraitha 3.2.0, Imagemagick 6.9.5, Ruby 2.3.

On "Snapping..." it freezes... it just creates the first images but not the thumbnails.
I've tried different options... basing on default capture.yaml config :/

@ChrisBAshton
Copy link
Contributor

We recommend using PhantomJS 2+. If upgrading Phantom does not work, please open a new issue.

Thanks

@Qlczas
Copy link

Qlczas commented Jul 25, 2016

Hi,
I had the issues as everyone else e.g. #441
when used Phantom 2+. It's not even starting to take screenshot.

With Phantom1.9.8 I got stuck at "snapping"...

@nimishsinghal
Copy link

Hi,
Even I am facing this issue Error: Cannot find module '../javascript/disable_javascript--phantom.js'. My version of PhantomJS is 2.1.7, I tried using 1.9.2 but support is not there for this version.

@jcmartinez
Copy link

Same issue here.
It only finishes the job when I have one screen resolution. If I configure more than one resolution, it freezes at the end.
I enabled "verbose: true" and I don't see feedback of anything breaking; however, it apparently freezes right before showing the "CROPPING IMAGES" message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants