mirror of https://github.com/vitalif/phantomjs
Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
Ariya Hidayat | e2295f805c | |
Ariya Hidayat | ffc594e264 | |
Ariya Hidayat | 78b1e271d6 | |
Ariya Hidayat | e524157c81 | |
Ariya Hidayat | 7944013141 | |
Ariya Hidayat | 1f685ec241 | |
Ariya Hidayat | c68082e3b1 |
|
@ -32,6 +32,7 @@ Please see also http://code.google.com/p/phantomjs/wiki/ReleaseNotes.
|
|||
* Fixed example scripts to exit with the right exit code (issue 544)
|
||||
* Fixed build failure with glib 2.31.0+ (issue 559)
|
||||
* Fixed error handler failures in some cases (issue 589)
|
||||
* Fixed Twitter-related examples to work with the new site (issue 609)
|
||||
|
||||
2012-03-20: Version 1.5.0 "Ghost Flower"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
PhantomJS ([www.phantomjs.org](http://phantomjs.org)) is a headless WebKit scriptable with JavaScript or CoffeeScript. It is used by hundreds of [developers](http://code.google.com/p/phantomjs/wiki/ExternalArticles) and dozens of [organizations](http://code.google.com/p/phantomjs/wiki/WhoUsesPhantomJS) for web-related development workflow.
|
||||
|
||||
The latest [stable release](http://code.google.com/p/phantomjs/wiki/ReleaseNotes) is version 1.5 (codenamed "Ghost Flower"). Follow the official Twitter stream [@HeadlessPhantom](http://twitter.com/HeadlessPhantom) to get the frequent development updates.
|
||||
The latest [stable release](http://code.google.com/p/phantomjs/wiki/ReleaseNotes) is version 1.6 (codenamed "Lavender"). Follow the official Twitter stream [@HeadlessPhantom](http://twitter.com/HeadlessPhantom) to get the frequent development updates.
|
||||
|
||||
PhantomJS is created and maintained by [Ariya Hidayat](http://ariya.ofilabs.com/about) (Twitter: [@ariyahidayat](http://twitter.com/ariyahidayat)), with the help of [many contributors](https://github.com/ariya/phantomjs/contributors).
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ follow = (user, callback) ->
|
|||
if status is 'fail'
|
||||
console.log user + ': ?'
|
||||
else
|
||||
data = page.evaluate -> document.querySelector('div.timeline-following').innerText
|
||||
data = page.evaluate -> document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
|
||||
console.log user + ': ' + data
|
||||
callback.apply()
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ function follow(user, callback) {
|
|||
console.log(user + ': ?');
|
||||
} else {
|
||||
var data = page.evaluate(function () {
|
||||
return document.querySelector('div.timeline-following').innerText;
|
||||
return document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
|
||||
});
|
||||
console.log(user + ': ' + data);
|
||||
}
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
p = require("webpage").create()
|
||||
p.onConsoleMessage = (msg) ->
|
||||
console.log msg
|
||||
|
||||
p.onCallback = (msg) ->
|
||||
console.log "Received by the 'phantom' main context: " + msg
|
||||
"Hello there, I'm coming to you from the 'phantom' context instead"
|
||||
|
||||
p.evaluate ->
|
||||
callbackResponse = phantomCallback("Hello, I'm coming to you from the 'page' context")
|
||||
console.log "Received by the 'page' context: " + callbackResponse
|
||||
|
||||
phantom.exit()
|
|
@ -1,17 +0,0 @@
|
|||
var p = require("webpage").create();
|
||||
|
||||
p.onConsoleMessage = function(msg) { console.log(msg); };
|
||||
|
||||
// Calls to "phantomCallback" within the page 'p' arrive here
|
||||
p.onCallback = function(msg) {
|
||||
console.log("Received by the 'phantom' main context: "+msg);
|
||||
return "Hello there, I'm coming to you from the 'phantom' context instead";
|
||||
};
|
||||
|
||||
p.evaluate(function() {
|
||||
// Return-value of the "onCallback" handler arrive here
|
||||
var callbackResponse = callPhantom("Hello, I'm coming to you from the 'page' context");
|
||||
console.log("Received by the 'page' context: "+callbackResponse);
|
||||
});
|
||||
|
||||
phantom.exit();
|
|
@ -25,7 +25,7 @@ page.open encodeURI("http://mobile.twitter.com/#{twitterId}"), (status) ->
|
|||
else
|
||||
# Execute some DOM inspection within the page context
|
||||
page.evaluate ->
|
||||
list = document.querySelectorAll 'span.status'
|
||||
list = document.querySelectorAll 'div.tweet-text'
|
||||
for i, j in list
|
||||
console.log "#{j + 1}: #{i.innerHTML.replace /<.*?>/g, ''}"
|
||||
console.log "#{j + 1}: #{i.innerText}"
|
||||
phantom.exit()
|
||||
|
|
|
@ -27,9 +27,9 @@ page.open(encodeURI("http://mobile.twitter.com/" + twitterId), function (status)
|
|||
} else {
|
||||
// Execute some DOM inspection within the page context
|
||||
page.evaluate(function() {
|
||||
var list = document.querySelectorAll('span.status');
|
||||
var list = document.querySelectorAll('div.tweet-text');
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
console.log((i + 1) + ": " + list[i].innerHTML.replace(/<.*?>/g, ''));
|
||||
console.log((i + 1) + ": " + list[i].innerText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#define PHANTOMJS_VERSION_MAJOR 1
|
||||
#define PHANTOMJS_VERSION_MINOR 6
|
||||
#define PHANTOMJS_VERSION_PATCH 0
|
||||
#define PHANTOMJS_VERSION_STRING "1.6.0 (development)"
|
||||
#define PHANTOMJS_VERSION_STRING "1.6.0"
|
||||
|
||||
#define COFFEE_SCRIPT_EXTENSION ".coffee"
|
||||
|
||||
|
|
Loading…
Reference in New Issue