Closed theguythatrepeatedit closed 8 years ago
Are you trying to take screenshots of http://develop.example.com? Because that doesn't exist, and will give an error.
Please reopen if this is not the case.
Hi again, I don't know how I reopen - but the URL is not the problem, no connection will be made and all I have is the general WARN out - this is facebook and github
F:\wrth>wraith capture configs/capture.yaml
DEBUG: #################################################
DEBUG: Command run: capture configs/capture.yaml
DEBUG: Wraith version: 3.2.0
DEBUG: Ruby version: ruby 2.3.0p0 (2015-12-25 revision 53290) [i386-mingw32]
DEBUG: ImageMagick: Version: ImageMagick 6.9.3-8 Q16 x64 2016-04-10 http://www.imagemagick.org
DEBUG: PhantomJS version: 2.1.1
DEBUG: CasperJS version: CasperJS not installed
DEBUG: #################################################
DEBUG:
Config validated. No serious issues found.
Creating Folders
SAVING IMAGES
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js' 'http://www.facebook.com/' '320' 'shots/home/320_phantomjs_current.png' 'body' 'F:/wrth/javascript/disable_javascript--phantom.js' 'false'
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js' 'http://github.com/' '320' 'shots/home/320_phantomjs_new.png' 'body' 'F:/wrth/javascript/disable_javascript--phantom.js' 'false'
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js' 'http://www.facebook.com/' '600x768' 'shots/home/600x768_phantomjs_current.png' 'body' 'F:/wrth/javascript/disable_javascript--phantom.js' 'false'
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js' 'http://github.com/' '600x768' 'shots/home/600x768_phantomjs_new.png' 'body' 'F:/wrth/javascript/disable_javascript--phantom.js' 'false'
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js' 'http://www.facebook.com/' '768' 'shots/home/768_phantomjs_current.png' 'body' 'F:/wrth/javascript/disable_javascript--phantom.js' 'false'
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js' 'http://github.com/' '768' 'shots/home/768_phantomjs_new.png' 'body' 'F:/wrth/javascript/disable_javascript--phantom.js' 'false'
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js' 'http://www.facebook.com/' '1024' 'shots/home/1024_phantomjs_current.png' 'body' 'F:/wrth/javascript/disable_javascript--phantom.js' 'false'
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js' 'http://github.com/' '1024' 'shots/home/1024_phantomjs_new.png' 'body' 'F:/wrth/javascript/disable_javascript--phantom.js' 'false'
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
WARN: Failed to capture image shots/home/600x768_phantomjs_current.png on attempt number 1 of 5
WARN: Failed to capture image shots/home/768_phantomjs_current.png on attempt number 1 of 5
WARN: Failed to capture image shots/home/320_phantomjs_current.png on attempt number 1 of 5
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
WARN: Failed to capture image shots/home/1024_phantomjs_current.png on attempt number 1 of 5
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
WARN: Failed to capture image shots/home/320_phantomjs_new.png on attempt number 1 of 5
WARN: Failed to capture image shots/home/600x768_phantomjs_new.png on attempt number 1 of 5
WARN: Failed to capture image shots/home/768_phantomjs_new.png on attempt number 1 of 5
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
WARN: Failed to capture image shots/home/1024_phantomjs_new.png on attempt number 1 of 5
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
WARN: Failed to capture image shots/home/600x768_phantomjs_current.png on attempt number 2 of 5
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
WARN: Failed to capture image shots/home/768_phantomjs_current.png on attempt number 2 of 5
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
WARN: Failed to capture image shots/home/320_phantomjs_current.png on attempt number 2 of 5
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
WARN: Failed to capture image shots/home/768_phantomjs_new.png on attempt number 2 of 5
WARN: Failed to capture image shots/home/1024_phantomjs_current.png on attempt number 2 of 5
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
WARN: Failed to capture image shots/home/320_phantomjs_new.png on attempt number 2 of 5
WARN: Failed to capture image shots/home/600x768_phantomjs_new.png on attempt number 2 of 5
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
ubWARN: Failed to capture image shots/home/1024_phantomjs_new.png on attempt number 2 of 5
ygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
WARN: Failed to capture image shots/home/600x768_phantomjs_current.png on attempt number 3 of 5
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
CCWARN: Failed to capture image shots/home/768_phantomjs_current.png on attempt number 3 of 5
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js''
a
It looks like Phantom isn't running properly. To determine if this is the case, try running one of those commands you can see in debug mode, i.e.
ubygems☻.2.0gemswraith-3.2.0libwraithjavascriptmyphantom.js' 'http://www.facebook.com/' '320' 'shots/home/320_phantomjs_current.png' 'body' 'F:/wrth/javascript/disable_javascript--phantom.js' 'false'
.. OK I tried out a few things now
Just to make sure - do you mean running the command like this ?
C:\Ruby23\lib\ruby\gems\2.3.0\gems\wraith-3.2.0\lib\wraith\javascript>phantomjs phantom.js http://facebook.com/
Failed over and over until I found that the apostrophes in the arguments most likely is the problem - so this will fail:
C:\Ruby23\lib\ruby\gems\2.3.0\gems\wraith-3.2.0\lib\wraith\javascript>phantomjs phantom.js 'http://www.facebook.com/' '768' 'shots/home/768_phantomjs_current.png' 'body' 'F:/wrth/javascript/disable_javascript--phantom.js' 'false'
Loading 'http://www.facebook.com/' at dimensions: NaNx1500
Error with page 'http://www.facebook.com/'
And this will pass
C:\Ruby23\lib\ruby\gems\2.3.0\gems\wraith-3.2.0\lib\wraith\javascript>phantomjs phantom.js http://facebook.com/ 768 shots/home/768_phantomjs_current.png body F:/wrth/javascript/disable_javascript--phantom.js false
Loading http://facebook.com/ at dimensions: 768x1500
Snapping http://facebook.com/ at: 768x1500
:)
Is there something wrong with my system that makes it so intolerable to paths and apostrophes, a setting or something ?
I am glad to have found another cause of failure, but not sure how I can fix this globally ? do you know
Oh lord, I finally made it! and I can not believe I'm the only one with this problem !? Maybe I'm the only one running Windows
Inside save_images.rb.construct_command - removed all variable apostrophes and hardcoded a new snapfile with double backslashes, like this:
snap = "C:\\Ruby23\\lib\\ruby\\gems\\2.3.0\\gems\\wraith-3.2.0\\lib\\wraith\\javascript\\phantom.js"
command_to_run = "#{meta.engine} #{wraith.phantomjs_options} #{snap} #{url} #{width} #{file_name} #{selector} #{global_before_capture} #{path_before_capture}"
PHEW :) I can probably make a real fix later in the week if anyone is interested
I know other Wraith users who run it on Windows, we've not seen this problem before. The quotes shouldn't affect it - and are needed in case you run in resize
mode (in which case, width
would be '320,624,1024', say... so inside the quotes, that's treated as one argument. Without quotes, it might be treated as several).
I'm also confused as to why you need to double backslash the snapfile path!
Moving issue to #489.
How is this not fixed yet? :) @theguythatrepeatedit you are a saver.
Hi, I have installed the below softwares and trying to run the wraith command in Windows 10. But i am facing the above mentioned issue. phantomjs --> 1.9.8 casperjs --> 1.1.4 ruby --> ruby 2.6.1p33 (2019-01-30 revision 66950) [x64-mingw32] image magic 7.0.4 wraith --> 4.2.3
Could any one help me in sorting out this issue ?
Oh lord, I finally made it! and I can not believe I'm the only one with this problem !? Maybe I'm the only one running Windows
Inside save_images.rb.construct_command - removed all variable apostrophes and hardcoded a new snapfile with double backslashes, like this:
snap = "C:\\Ruby23\\lib\\ruby\\gems\\2.3.0\\gems\\wraith-3.2.0\\lib\\wraith\\javascript\\phantom.js" command_to_run = "#{meta.engine} #{wraith.phantomjs_options} #{snap} #{url} #{width} #{file_name} #{selector} #{global_before_capture} #{path_before_capture}"
PHEW :) I can probably make a real fix later in the week if anyone is interested
This fix is not worked for me in Windows 10. Could you please help me ?
Hi there, after having overcome the issue of https://github.com/BBC-News/wraith/issues/441, I am now stuck with a general WARN: Failed to capture image shots
I don't get any more information than that through the verbose logging. I have verified that phantomjs runs fine in isolation. But when running through wraith it will not load anything, I set up a proxy and saw no traffic leaving my machine at all. How can I debug this further ?