PhantomJS screenshot crash but now on phantomjscloud.com

391 views
Skip to first unread message

Salvatore Fresta

unread,
Apr 18, 2017, 5:10:18 PM4/18/17
to phantomjs
Hello,

I have to do a screenshot of puntoricarica.it with PhantomJS 2.1.1. I'm using the following code:

var webPage = require('webpage');
var page = webPage.create();


page
.viewportSize = { width: 1024, height: 768 };
page
.settings.userAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36';




page
.open("http://www.puntoricarica.it", function(status) {
 
 
if (status !== 'success') {
    console
.log('Unable to load the address!');
    phantom
.exit(1);
 
}
 
  page
.render("screenshot.png");
  phantom
.exit();


});


but it doesnt' work:

phantomjs --debug=true --web-security=no --ssl-protocol=any --ignore-ssl-errors=yes script.js

Debug:

2017-04-18T23:05:50 [DEBUG] CookieJar - Created but will not store cookies (use option '--cookies-file=<filename>' to enable persistent cookie storage)
2017-04-18T23:05:50 [DEBUG] Set  "http"  proxy to:  "" : 1080
2017-04-18T23:05:50 [DEBUG] Phantom - execute: Configuration
2017-04-18T23:05:50 [DEBUG]      0 objectName : ""
2017-04-18T23:05:50 [DEBUG]      1 cookiesFile : ""
2017-04-18T23:05:50 [DEBUG]      2 diskCacheEnabled : "false"
2017-04-18T23:05:50 [DEBUG]      3 maxDiskCacheSize : "-1"
2017-04-18T23:05:50 [DEBUG]      4 diskCachePath : ""
2017-04-18T23:05:50 [DEBUG]      5 ignoreSslErrors : "true"
2017-04-18T23:05:50 [DEBUG]      6 localUrlAccessEnabled : "true"
2017-04-18T23:05:50 [DEBUG]      7 localToRemoteUrlAccessEnabled : "false"
2017-04-18T23:05:50 [DEBUG]      8 outputEncoding : "UTF-8"
2017-04-18T23:05:50 [DEBUG]      9 proxyType : "http"
2017-04-18T23:05:50 [DEBUG]      10 proxy : ":1080"
2017-04-18T23:05:50 [DEBUG]      11 proxyAuth : ":"
2017-04-18T23:05:50 [DEBUG]      12 scriptEncoding : "UTF-8"
2017-04-18T23:05:50 [DEBUG]      13 webSecurityEnabled : "false"
2017-04-18T23:05:50 [DEBUG]      14 offlineStoragePath : ""
2017-04-18T23:05:50 [DEBUG]      15 localStoragePath : ""
2017-04-18T23:05:50 [DEBUG]      16 localStorageDefaultQuota : "-1"
2017-04-18T23:05:50 [DEBUG]      17 offlineStorageDefaultQuota : "-1"
2017-04-18T23:05:50 [DEBUG]      18 printDebugMessages : "true"
2017-04-18T23:05:50 [DEBUG]      19 javascriptCanOpenWindows : "true"
2017-04-18T23:05:50 [DEBUG]      20 javascriptCanCloseWindows : "true"
2017-04-18T23:05:50 [DEBUG]      21 sslProtocol : "any"
2017-04-18T23:05:50 [DEBUG]      22 sslCiphers : "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-RC4-SHA:ECDHE-RSA-RC4-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:RC4-SHA:RC4-MD5"
2017-04-18T23:05:50 [DEBUG]      23 sslCertificatesPath : ""
2017-04-18T23:05:50 [DEBUG]      24 sslClientCertificateFile : ""
2017-04-18T23:05:50 [DEBUG]      25 sslClientKeyFile : ""
2017-04-18T23:05:50 [DEBUG]      26 sslClientKeyPassphrase : ""
2017-04-18T23:05:50 [DEBUG]      27 webdriver : ":"
2017-04-18T23:05:50 [DEBUG]      28 webdriverLogFile : ""
2017-04-18T23:05:50 [DEBUG]      29 webdriverLogLevel : "INFO"
2017-04-18T23:05:50 [DEBUG]      30 webdriverSeleniumGridHub : ""
2017-04-18T23:05:50 [DEBUG] Phantom - execute: Script & Arguments
2017-04-18T23:05:50 [DEBUG]      script: "script.js"
2017-04-18T23:05:50 [DEBUG] Phantom - execute: Starting normal mode
2017-04-18T23:05:50 [DEBUG] WebPage - setupFrame ""
2017-04-18T23:05:50 [DEBUG] FileSystem - _open: ":/modules/fs.js" QMap(("mode", QVariant(QString, "r")))
2017-04-18T23:05:50 [DEBUG] FileSystem - _open: ":/modules/system.js" QMap(("mode", QVariant(QString, "r")))
2017-04-18T23:05:50 [DEBUG] FileSystem - _open: ":/modules/webpage.js" QMap(("mode", QVariant(QString, "r")))
2017-04-18T23:05:50 [DEBUG] WebPage - updateLoadingProgress: 10
2017-04-18T23:05:51 [DEBUG] WebPage - updateLoadingProgress: 30
2017-04-18T23:05:51 [DEBUG] WebPage - updateLoadingProgress: 32
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/style.css"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/skins/blue.css"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/css/nivo-slider.css"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/responsive.css"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/js/jquery.min.js"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/js/jquery.tabs.min.js"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/js/jquery.jcarousel.min.js"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/js/tinynav.min.js"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/js/ultimate-custom.js"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/js/jquery.nivo.slider.js"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/css/prettyPhoto.css"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] WebPage - updateLoadingProgress: 34
2017-04-18T23:05:51 [DEBUG] WebPage - setupFrame ""
ReferenceError: Can't find variable: $


  http://www.puntoricarica.it/:71 in global code
ReferenceError: Can'
t find variable: $


  http
://www.puntoricarica.it/:90 in global code
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/js/jquery.validate.min.js"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
ReferenceError: Can't find variable: jQuery


  http://www.puntoricarica.it/:99 in global code
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/js/jquery.prettyPhoto.js"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/js/sendmail.js"
2017-04-18T23:05:51 [WARNING] QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/images/postepay_ric_l.jpg"
2017-04-18T23:05:51 [DEBUG] WebPage - updateLoadingProgress: 100
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/images/pagamento_tasi.jpg"
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/images/pagamento_tares.jpg"
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/images/pagamento_bollo.jpg"
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/images/pagamento_f35.jpg"
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/images/pagamento_bollettini.jpg"
2017-04-18T23:05:51 [DEBUG] WebPage - updateLoadingProgress: 10
Unable to load the address!
2017-04-18T23:05:51 [DEBUG] WebPage - setupFrame ""
2017-04-18T23:05:51 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(OperationCanceledError) ( "Operation canceled" ) URL: "http://www.puntoricarica.it/web"
2017-04-18T23:05:51 [DEBUG] WebPage - updateLoadingProgress: 100
2017-04-18T23:05:51 [DEBUG] WebPage - updateLoadingProgress: 10
2017-04-18T23:05:51 [DEBUG] WebPage - setupFrame ""
2017-04-18T23:05:51 [DEBUG] WebPage - updateLoadingProgress: 100
2017-04-18T23:05:51 [DEBUG] WebPage - setupFrame ""
2017-04-18T23:05:51 [DEBUG] FileSystem - _open: ":/modules/fs.js" QMap(("mode", QVariant(QString, "r")))
2017-04-18T23:05:51 [DEBUG] FileSystem - _open: ":/modules/system.js" QMap(("mode", QVariant(QString, "r")))
2017-04-18T23:05:51 [DEBUG] FileSystem - _open: ":/modules/webpage.js" QMap(("mode", QVariant(QString, "r")))
2017-04-18T23:05:51 [DEBUG] WebPage - updateLoadingProgress: 10
2017-04-18T23:05:51 [DEBUG] WebPage - setupFrame ""
2017-04-18T23:05:51 [DEBUG] FileSystem - _open: ":/modules/fs.js" QMap(("mode", QVariant(QString, "r")))
2017-04-18T23:05:51 [DEBUG] FileSystem - _open: ":/modules/system.js" QMap(("mode", QVariant(QString, "r")))
2017-04-18T23:05:51 [DEBUG] FileSystem - _open: ":/modules/webpage.js" QMap(("mode", QVariant(QString, "r")))
2017-04-18T23:05:51 [DEBUG] WebPage - updateLoadingProgress: 100
2017-04-18T23:05:51 [DEBUG] WebPage - setupFrame ""


But it works well on phantomjscloud.com:


Any suggestions?
Thanks in advance
Reply all
Reply to author
Forward
0 new messages