Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F4943164
phantomjs
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Ejegg
Dec 2 2016, 7:57 PM
2016-12-02 19:57:10 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
phantomjs
View Options
var page = require('webpage').create();
page.onResourceRequested = function(request) {
// console.log('Request ' + JSON.stringify(request, undefined, 4));
};
page.onResourceReceived = function(response) {
// console.log('Receive ' + JSON.stringify(response, undefined, 4));
};
page.onError = function(message, trace) {
console.log( 'Error: ' + message );
};
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open('https://en.wikipedia.org/wiki/Fla-Vor-Ice', function(status) {
console.log( 'Looking for ChoiceData' );
var choiceData = page.evaluate( function() {
//return 'title: ' + document.title;
if ( !window.mediaWiki ) {
return 'Mediawiki not defined';
}
if ( !window.mediaWiki.centralNotice ) {
return 'mw.cn not defined';
}
if ( window.mediaWiki.centralNotice.choiceData ) {
return 'ChoiceData: ' + JSON.stringify( window.mediaWiki.centralNotice.choiceData );
} else {
return 'ChoiceData not defined' ;
}
} );
console.log( choiceData );
} );
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4177664
Default Alt Text
phantomjs (1 KB)
Attached To
Mode
P4559 phantomjs
Attached
Detach File
Event Timeline
Log In to Comment