Failed to load page with phantomjs, javascript is presumably not enabled / supported

I am trying to clear print logs from an HP printer. The page content is not loading. There is one hint below, but I'm not sure if I know how to get around it.

<noscript> &lt;div id="pgm-no-js-text"&gt; &lt;p&gt;JavaScript is
required to access this website.&lt;/p&gt;

&lt;p&gt;Please enable JavaScript or use a browser that supports
JavaScript.&lt;/p&gt; &lt;/div&gt; </noscript>

      

Here is the code I am using

var url =''; // printer web interface IP, tried http:// and https://
var page = require('webpage').create();

console.log("klik 0");

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.settings.javascriptEnabled = true;
//page.viewportSize = { width: 1920, height: 1080 };

page.onLoadFinished = function() {
  console.log("### finished loading page");
};

page.open(url, function(status) {
  setTimeout(function() {
  console.log("Status: " + status);

  if (status === "success") {
    console.log("klik1 OK");
    console.log(page.content);
    phantom.exit(1);
  } else {
    console.log("eeeek, no go");
    phantom.exit();
  }
}, 3000);
});

      

Is it possible that an additional .js script (600 kb size) that is implemented in the page

<script src="./HP Officejet Pro X476dw MFP_files/Unified.js" type="text/javascript"></script>

      

is somehow preventing me from loading the page other than manually? If I take a screenshot through page.render

but it only loads part of the background and nothing else. Any advice on how I can debug this myself would be greatly appreciated.

Verbose debug output as I do phantomjs --debug=true script.js

. PhantomJS 2.1.1 on Ubuntu 16.04.

2017-03-24T15:35:17 [DEBUG] CookieJar - Created but will not store cookies (use option '--cookies-file=<filename>' to enable persistent cookie storage)
2017-03-24T15:35:17 [DEBUG] Set  "http"  proxy to:  "" : 1080
2017-03-24T15:35:17 [DEBUG] Phantom - execute: Configuration
2017-03-24T15:35:17 [DEBUG]      0 objectName : ""
2017-03-24T15:35:17 [DEBUG]      1 cookiesFile : ""
2017-03-24T15:35:17 [DEBUG]      2 diskCacheEnabled : "false"
2017-03-24T15:35:17 [DEBUG]      3 maxDiskCacheSize : "-1"
2017-03-24T15:35:17 [DEBUG]      4 diskCachePath : ""
2017-03-24T15:35:17 [DEBUG]      5 ignoreSslErrors : "false"
2017-03-24T15:35:17 [DEBUG]      6 localUrlAccessEnabled : "true"
2017-03-24T15:35:17 [DEBUG]      7 localToRemoteUrlAccessEnabled : "false"
2017-03-24T15:35:17 [DEBUG]      8 outputEncoding : "UTF-8"
2017-03-24T15:35:17 [DEBUG]      9 proxyType : "http"
2017-03-24T15:35:17 [DEBUG]      10 proxy : ":1080"
2017-03-24T15:35:17 [DEBUG]      11 proxyAuth : ":"
2017-03-24T15:35:17 [DEBUG]      12 scriptEncoding : "UTF-8"
2017-03-24T15:35:17 [DEBUG]      13 webSecurityEnabled : "true"
2017-03-24T15:35:17 [DEBUG]      14 offlineStoragePath : ""
2017-03-24T15:35:17 [DEBUG]      15 localStoragePath : ""
2017-03-24T15:35:17 [DEBUG]      16 localStorageDefaultQuota : "-1"
2017-03-24T15:35:17 [DEBUG]      17 offlineStorageDefaultQuota : "-1"
2017-03-24T15:35:17 [DEBUG]      18 printDebugMessages : "true"
2017-03-24T15:35:17 [DEBUG]      19 javascriptCanOpenWindows : "true"
2017-03-24T15:35:17 [DEBUG]      20 javascriptCanCloseWindows : "true"
2017-03-24T15:35:17 [DEBUG]      21 sslProtocol : "default"
2017-03-24T15:35:17 [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:...-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-03-24T15:35:17 [DEBUG]      23 sslCertificatesPath : ""
2017-03-24T15:35:17 [DEBUG]      24 sslClientCertificateFile : ""
2017-03-24T15:35:17 [DEBUG]      25 sslClientKeyFile : ""
2017-03-24T15:35:17 [DEBUG]      26 sslClientKeyPassphrase : ""
2017-03-24T15:35:17 [DEBUG]      27 webdriver : ":"
2017-03-24T15:35:17 [DEBUG]      28 webdriverLogFile : ""
2017-03-24T15:35:17 [DEBUG]      29 webdriverLogLevel : "INFO"
2017-03-24T15:35:17 [DEBUG]      30 webdriverSeleniumGridHub : ""
2017-03-24T15:35:17 [DEBUG] Phantom - execute: Script & Arguments
2017-03-24T15:35:17 [DEBUG]      script: "ws.js"
2017-03-24T15:35:17 [DEBUG] Phantom - execute: Starting normal mode
2017-03-24T15:35:17 [DEBUG] WebPage - setupFrame ""
2017-03-24T15:35:17 [DEBUG] FileSystem - _open: ":/modules/fs.js" QMap(("mode", QVariant(QString, "r")))
2017-03-24T15:35:17 [DEBUG] FileSystem - _open: ":/modules/system.js" QMap(("mode", QVariant(QString, "r")))
2017-03-24T15:35:17 [DEBUG] FileSystem - _open: ":/modules/webpage.js" QMap(("mode", QVariant(QString, "r")))
klik 0
2017-03-24T15:35:17 [DEBUG] WebPage - updateLoadingProgress: 10
2017-03-24T15:35:17 [DEBUG] CookieJar - Saved "sid=-a79d467495756243f01f3edf9eba7bbd; domain=; path=/"
2017-03-24T15:35:17 [DEBUG] WebPage - updateLoadingProgress: 30
2017-03-24T15:35:17 [DEBUG] WebPage - updateLoadingProgress: 35
2017-03-24T15:35:17 [DEBUG] WebPage - updateLoadingProgress: 37
2017-03-24T15:35:17 [DEBUG] WebPage - updateLoadingProgress: 40
2017-03-24T15:35:17 [DEBUG] WebPage - updateLoadingProgress: 42
2017-03-24T15:35:17 [DEBUG] WebPage - updateLoadingProgress: 45
2017-03-24T15:35:17 [DEBUG] WebPage - updateLoadingProgress: 47
2017-03-24T15:35:17 [DEBUG] WebPage - updateLoadingProgress: 49
2017-03-24T15:35:17 [DEBUG] WebPage - setupFrame ""
2017-03-24T15:35:17 [DEBUG] WebPage - setupFrame "<!--framePath //<!--frame0-->-->"
2017-03-24T15:35:17 [DEBUG] WebPage - updateLoadingProgress: 50
2017-03-24T15:35:17 [DEBUG] WebPage - updateLoadingProgress: 50
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 52
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 56
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 59
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 62
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 65
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 68
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 70
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 73
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 75
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 77
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 79
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 81
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 84
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 86
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 88
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 90
2017-03-24T15:35:18 [DEBUG] WebPage - updateLoadingProgress: 100
### finished loading page
2017-03-24T15:35:18 [DEBUG] WebPage - setupFrame ""
Status: success
klik1 OK
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="/framework/Unified.css" rel="stylesheet" type="text/css">

  <script type="text/javascript">
  frameWorkObj = {};
  frameWorkObj.pkg = "ews";
  </script>

 ... abbreviated content...

// frame buster
if(top != self)
  top.location.replace(self.location.href);
</script>

<noscript>
&lt;div id="pgm-no-js-text"&gt;
&lt;p&gt;JavaScript is required to access this website.&lt;/p&gt;

&lt;p&gt;Please enable JavaScript or use a browser that supports JavaScript.&lt;/p&gt;
&lt;/div&gt;
</noscript>


<div id="ui-datepicker-div" style="display: none;"></div><div id="tooltip" style="display: none;"><div><div id="background"><img src="/images/framework/tooltip_bg.png"></div><div id="content"><h3></h3><div class="body"></div><div class="url"></div></div></div></div></body></html>
2017-03-24T15:35:21 [DEBUG] WebPage - setupFrame ""
2017-03-24T15:35:21 [DEBUG] WebPage - updateLoadingProgress: 10
2017-03-24T15:35:21 [DEBUG] WebPage - setupFrame ""
2017-03-24T15:35:21 [DEBUG] WebPage - updateLoadingProgress: 100
2017-03-24T15:35:21 [DEBUG] WebPage - setupFrame ""
2017-03-24T15:35:21 [DEBUG] FileSystem - _open: ":/modules/fs.js" QMap(("mode", QVariant(QString, "r")))
2017-03-24T15:35:21 [DEBUG] FileSystem - _open: ":/modules/system.js" QMap(("mode", QVariant(QString, "r")))
2017-03-24T15:35:21 [DEBUG] FileSystem - _open: ":/modules/webpage.js" QMap(("mode", QVariant(QString, "r")))
2017-03-24T15:35:21 [DEBUG] WebPage - updateLoadingProgress: 10
2017-03-24T15:35:21 [DEBUG] WebPage - setupFrame ""
2017-03-24T15:35:21 [DEBUG] FileSystem - _open: ":/modules/fs.js" QMap(("mode", QVariant(QString, "r")))
2017-03-24T15:35:21 [DEBUG] FileSystem - _open: ":/modules/system.js" QMap(("mode", QVariant(QString, "r")))
2017-03-24T15:35:21 [DEBUG] FileSystem - _open: ":/modules/webpage.js" QMap(("mode", QVariant(QString, "r")))
2017-03-24T15:35:21 [DEBUG] WebPage - updateLoadingProgress: 100
2017-03-24T15:35:21 [DEBUG] CookieJar - Purged (session) "sid=sd5607228-a793edf9eba7bbd; domain=; path=/"

      

+3


source to share





All Articles