ISC License

项目介绍

amir20/phantomjs-node 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,采用 ISC License 许可证,目前获得 3.5k 个 Star、460 次 Fork。

仓库全名
amir20/phantomjs-node
开源许可证
ISC License
Star 数
3.5k
Fork 数
460

README 摘要

Notice Development on this project has been suspended due to lack of support for PhantomJs. phantom - Fast NodeJS API for PhantomJS ======== Super easy to use 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. The above command is very…

完整内容见 GitHub 原始 README 或本页 。

常见问题

phantomjs-node 用什么语言开发?

主要使用 JavaScript 编写,采用 ISC License 许可证,目前有 3.5k 个 Star。

phantomjs-node 可以免费商用吗?

仓库采用 ISC License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 phantomjs-node 的源码?

可以直接克隆仓库:git clone https://github.com/amir20/phantomjs-node.git,默认分支为 master;安装与运行步骤见仓库 README。

phantomjs-node 最近还在维护吗?

仓库最近一次更新为 2019年12月4日,当前没有未关闭的 Issue;Star 数为 3.5k,可作为社区活跃度的参考。

简要分析

热度分
4437
价值分
2247
活跃状态
归档

语言占比

JavaScript

Release

README

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

评论

暂无评论