LoginSignup
22
22

More than 5 years have passed since last update.

Phantom.jsの高レベルAPIのNightmareを試す

Last updated at Posted at 2014-10-07

検証環境

OSX 10.9.4

Github Page

Github

使い方(テストケース)

セットアップ

Phantom.jsをインストールする

$ sudo brew update && brew install phantomjs

少し時間がかかる

npmをインストールする

$ brew install npm

nightmareをインストールする

$ npm install --save nightmare

デモ

demo.jsを作成

demo.js
var Nightmare = require('nightmare');
new Nightmare()
  .goto('http://google.co.jp')
  .screenshot('./google.png')
  .run();

実行

$ node ./demo.js

スクリーンショットを確認する

$ open ./google.png

google.png

22
22
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
22