phantom

WebJar for phantom

License

License

MIT
Categories

Categories

Ant Build Tools
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

phantom
Last Version

Last Version

0.8.0
Release Date

Release Date

Type

Type

jar
Description

Description

phantom
WebJar for phantom
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sgentle/phantomjs-node

Download phantom

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/phantom/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>phantom</artifactId>
    <version>0.8.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/phantom/
implementation 'org.webjars.npm:phantom:0.8.0'
// https://jarcasting.com/artifacts/org.webjars.npm/phantom/
implementation ("org.webjars.npm:phantom:0.8.0")
'org.webjars.npm:phantom:jar:0.8.0'
<dependency org="org.webjars.npm" name="phantom" rev="0.8.0">
  <artifact name="phantom" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='phantom', version='0.8.0')
)
libraryDependencies += "org.webjars.npm" % "phantom" % "0.8.0"
[org.webjars.npm/phantom "0.8.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.webjars.npm » dnode jar [1.2.2,)
org.webjars.npm : shoe jar [0.0.15,0.1)
org.webjars.npm : win-spawn jar [2.0.0,2.1)
org.webjars.npm : traverse jar [0.6.3,0.7)

Project Modules

There are no modules declared in this project.

Notice

Development on this project has been suspended due to lack of support for PhantomJs.

phantom - Fast NodeJS API for PhantomJS

NPM

NPM Version NPM Downloads Linux Build Node Version

Super easy to use

const phantom = require('phantom');

(async function() {
  const instance = await phantom.create();
  const page = await instance.createPage();
  await page.on('onResourceRequested', function(requestData) {
    console.info('Requesting', requestData.url);
  });

  const status = await page.open('https://stackoverflow.com/');
  const content = await page.property('content');
  console.log(content);

  await instance.exit();
})();

Using Node v7.9.0+ you can run the above example with node file.js

See examples folder for more ways to use this module.

Use it with npx

You can quickly test any website with phantomjs-node without needing to install the package.

$ npx phantom@latest https://stackoverflow.com/

The above command is very useful to test if your website works on older browsers. I frequently use it to ensure polyfills have been installed correctly.

Deprecation warnings of PhantomJs

In March 2018, the owner of PhantomJS announced suspension of development. There hasn't been any updates since. Since phantomjs-node is only a wrapper around phantomjs, then you should use it at your own risk because the underlying dependency is no longer supported. I plan to maintain this project until usage has dropped significantly.

Installation

Node v6.x and later

Latest version of phantom does require Node v6.x and later. You can install with

$ npm install phantom --save

Node v5.x

To use version 3.x you need to have at least Node v5+. You can install it using

$ npm install phantom@3 --save

Versions older than 5.x, install with

$ npm install phantom@2 --save

Documents

Pooling

Creating new phantom instances with phantom.create() can be slow. If you are frequently creating new instances and destroying them, as a result of HTTP requests for example, it might be worth creating a pool of instances that are re-used.

See the phantom-pool module for more info.

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

Contributing

This package is under development. Pull requests are welcomed. Please make sure tests are added for new functionalities and that your build does pass in TravisCI.

People

The current lead maintainer is Amir Raminfar

List of all contributors

License

ISC

Versions

Version
0.8.0