Skip to content
sync version of phantomjs-node
CoffeeScript Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib Package upgrade + bugfixe
test travis fix
.gitignore
.travis.yml travis fix
Cakefile
LICENSE.txt
README.md
index.coffee Initial commit
index.js Package upgrade + bugfixe
package.json

README.md

Note: I don't really use nor support my fibers related packages, If someone is using it and willing to take over, let me know.

node-phantomjs-sync Build Status

Note: API change in version 1.0.0, see section below.

This is a synchronous version of the phantom for node module using fibers.

install

npm install phantom-sync

upgrade to V1

The main changes are the following:

  • 1/ async and mixed mode options have been removed
  • 2/ require should be: {phantom,sync} = require 'phantom-sync'
  • 3/ no need to create a Phantom object

usage (coffeescript)

{phantom,sync} = require 'phantom-sync'

sync ->
  ph = phantom.create()
  page = ph.createPage()
  status = page.open "http://www.google.com"
  console.log "status=", status  
  title = page.evaluate ->
    document.title
  console.log "title=", title
  ph.exit()  

API

This is the phantom for node API where that callbacks have been transformed into returns. Therefore it should be very similar to the PhantomJS API, except for the getters/setters function which need to be called like in the following code:

page.set 'settings.loadImages', false
page.get 'settings.loadImages'

Bitdeli Badge

Something went wrong with that request. Please try again.