Get page content


#1

Hello, please show me example, how i can get this(https://www.whoscored.com/Accounts/Login) page content

var page = require(‘webpage’).create();
page.open(‘https://www.whoscored.com/Accounts/Login’, function(status) {

console.log("Status: " + status);
if(status === "success") {
    page.render('whoscored.com.png');
}
phantom.exit();

});

result

phantomjs --ignore-ssl-errors=yes --ssl-protocol=any --debug=true test.js [70/70]
root@Sem-PC:/home/sem/www/phantom.loc/httpdocs# phantomjs --ignore-ssl-errors=yes --ssl-protocol=any --debug=true test.js
2016-06-25T23:08:33 [DEBUG] CookieJar - Created but will not store cookies (use option ‘–cookies-file=’ to enable persisten cookie stor
age)
2016-06-25T23:08:33 [DEBUG] Phantom - execute: Configuration
2016-06-25T23:08:33 [DEBUG] 0 objectName : ""
2016-06-25T23:08:33 [DEBUG] 1 cookiesFile : ""
2016-06-25T23:08:33 [DEBUG] 2 diskCacheEnabled : "false"
2016-06-25T23:08:33 [DEBUG] 3 maxDiskCacheSize : "-1"
2016-06-25T23:08:33 [DEBUG] 4 ignoreSslErrors : "true"
2016-06-25T23:08:33 [DEBUG] 5 localToRemoteUrlAccessEnabled : "false"
2016-06-25T23:08:33 [DEBUG] 6 outputEncoding : "UTF-8"
2016-06-25T23:08:33 [DEBUG] 7 proxyType : "http"
2016-06-25T23:08:33 [DEBUG] 8 proxy : ":1080"
2016-06-25T23:08:33 [DEBUG] 9 proxyAuth : ":"
2016-06-25T23:08:33 [DEBUG] 10 scriptEncoding : "UTF-8"
2016-06-25T23:08:33 [DEBUG] 11 webSecurityEnabled : "true"
2016-06-25T23:08:33 [DEBUG] 12 offlineStoragePath : ""
2016-06-25T23:08:33 [DEBUG] 13 offlineStorageDefaultQuota : "-1"
2016-06-25T23:08:33 [DEBUG] 14 printDebugMessages : "true"
2016-06-25T23:08:33 [DEBUG] 15 javascriptCanOpenWindows : "true"
2016-06-25T23:08:33 [DEBUG] 16 javascriptCanCloseWindows : "true"
2016-06-25T23:08:33 [DEBUG] 17 sslProtocol : "any"
2016-06-25T23:08:33 [DEBUG] 18 sslCertificatesPath : ""
2016-06-25T23:08:33 [DEBUG] 19 webdriver : ":"
2016-06-25T23:08:33 [DEBUG] 20 webdriverLogFile : ""
2016-06-25T23:08:33 [DEBUG] 21 webdriverLogLevel : "INFO"
2016-06-25T23:08:33 [DEBUG] 22 webdriverSeleniumGridHub : ""
2016-06-25T23:08:33 [DEBUG] Phantom - execute: Script & Arguments
2016-06-25T23:08:33 [DEBUG] script: "test.js"
2016-06-25T23:08:33 [DEBUG] Phantom - execute: Starting normal mode
2016-06-25T23:08:33 [DEBUG] WebPage - setupFrame ""
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/fs.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/system.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/_coffee-script.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/package.json” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/./lib/coffee-script/coffee-script.js” QMap((“mode”, QVariant(QString,
“r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/./lib/coffee-script/./lexer.js” QMap((“mode”, QVariant(QString, “r”) )
)
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/./lib/coffee-script/././rewriter.js” QMap((“mode”, QVariant(QString, “
r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/./lib/coffee-script/././helpers.js” QMap((“mode”, QVariant(QString, “r
”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/./lib/coffee-script/./parser.js” QMap((“mode”, QVariant(QString, “r”)
) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/./lib/coffee-script/./helpers.js” QMap((“mode”, QVariant(QString, “r”)
) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/./lib/coffee-script/./nodes.js” QMap((“mode”, QVariant(QString, “r”) )
)
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/./lib/coffee-script/././scope.js” QMap((“mode”, QVariant(QString, “r”)
) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/./lib/coffee-script/./././helpers.js” QMap((“mode”, QVariant(QString,
“r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/./lib/coffee-script/././lexer.js” QMap((“mode”, QVariant(QString, “r”)
) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/…/coffee-script/./lib/coffee-script/./././rewriter.js” QMap((“mode”, QVariant(QString,
“r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/webpage.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] WebPage - updateLoadingProgress: 10
2016-06-25T23:08:33 [DEBUG] CookieJar - Saved "visid_incap_774904=mjbAZMUlRXGuyckx8AisXMDkblcAAAAAQUIPAAAAAAB/bI34W/TNcUuOPCtkNsiz; expires=Sun, 2
5-Jun-2017 15:12:21 GMT; domain=.whoscored.com; path=/"
2016-06-25T23:08:33 [DEBUG] CookieJar - Saved "incap_ses_259_774904=3rVMCAe+42qCY3esWCeYA8DkblcAAAAAmltzixzQh7jaloN3KfG2zw==; domain=.whoscored.co
m; path=/"
2016-06-25T23:08:33 [DEBUG] WebPage - updateLoadingProgress: 31
2016-06-25T23:08:33 [DEBUG] WebPage - setupFrame ""
SyntaxError: Parse error

2016-06-25T23:08:33 [DEBUG] CookieJar - Saved "visid_incap_774904=mjbAZMUlRXGuyckx8AisXMDkblcAAAAAQUIPAAAAAAB/bI34W/TNcUuOPCtkNsiz; expires=Sun, 2
5-Jun-2017 15:12:21 GMT; domain=.whoscored.com; path=/"
2016-06-25T23:08:33 [DEBUG] CookieJar - Saved "incap_ses_259_774904=3rVMCAe+42qCY3esWCeYA8DkblcAAAAAmltzixzQh7jaloN3KfG2zw==; domain=.whoscored.co
m; path=/"
2016-06-25T23:08:33 [DEBUG] CookieJar - Saved "___utmvmFYuXSiS=YXNghYTWJzp; expires=Sat, 25-Jun-2016 20:23:33 GMT; domain=www.whoscored.com; path=
/"
2016-06-25T23:08:33 [DEBUG] CookieJar - Saved "___utmvaFYuXSiS=tUakOVJ; expires=Sat, 25-Jun-2016 20:23:33 GMT; domain=www.whoscored.com; path=/"
2016-06-25T23:08:33 [DEBUG] CookieJar - Saved "___utmvbFYuXSiS=uZx XzpOoalD: etd; expires=Sat, 25-Jun-2016 20:23:33 GMT; domain=www.whoscored.com;
path=/"
2016-06-25T23:08:33 [DEBUG] WebPage - updateLoadingProgress: 50
2016-06-25T23:08:33 [DEBUG] WebPage - updateLoadingProgress: 100
2016-06-25T23:08:33 [DEBUG] WebPage - updateLoadingProgress: 10
Status: success
2016-06-25T23:08:33 [DEBUG] WebPage - setupFrame ""
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/fs.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/system.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/_coffee-script.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/webpage.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] WebPage - updateLoadingProgress: 10
2016-06-25T23:08:33 [DEBUG] WebPage - setupFrame ""
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/fs.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/system.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/_coffee-script.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] FileSystem - _open: “:/modules/webpage.js” QMap((“mode”, QVariant(QString, “r”) ) )
2016-06-25T23:08:33 [DEBUG] WebPage - updateLoadingProgress: 100
2016-06-25T23:08:33 [DEBUG] WebPage - setupFrame ""
2016-06-25T23:08:33 [DEBUG] Network - Resource request error: 5 ( “Operation canceled” ) URL: "https://www.whoscored.com/Accounts/Login"
2016-06-25T23:08:33 [DEBUG] WebPage - updateLoadingProgress: 100
2016-06-25T23:08:33 [DEBUG] WebPage - updateLoadingProgress: 10
2016-06-25T23:08:33 [DEBUG] WebPage - setupFrame ""
2016-06-25T23:08:33 [DEBUG] WebPage - updateLoadingProgress: 100
2016-06-25T23:08:33 [DEBUG] WebPage - setupFrame ""
2016-06-25T23:08:33 [DEBUG] CookieJar - Purged (session) "incap_ses_259_774904=3rVMCAe+42qCY3esWCeYA8DkblcAAAAAmltzixzQh7jaloN3KfG2zw==; domain=.w
hoscored.com; path=/"
2016-06-25T23:08:33 [DEBUG] CookieJar - Saved "visid_incap_774904=mjbAZMUlRXGuyckx8AisXMDkblcAAAAAQUIPAAAAAAB/bI34W/TNcUuOPCtkNsiz; expires=Sun, 2
5-Jun-2017 15:12:21 GMT; domain=.whoscored.com; path=/"
2016-06-25T23:08:33 [DEBUG] CookieJar - Saved "___utmvmFYuXSiS=YXNghYTWJzp; expires=Sat, 25-Jun-2016 20:23:33 GMT; domain=www.whoscored.com; path=
/"
2016-06-25T23:08:33 [DEBUG] CookieJar - Saved "___utmvaFYuXSiS=tUakOVJ; expires=Sat, 25-Jun-2016 20:23:33 GMT; domain=www.whoscored.com; path=/"
2016-06-25T23:08:33 [DEBUG] CookieJar - Saved “___utmvbFYuXSiS=uZx XzpOoalD: etd; expires=Sat, 25-Jun-2016 20:23:33 GMT; domain=www.whoscored.com;
path=/”