LoginSignup
7
7

More than 5 years have passed since last update.

phantomJSのタイムアウト

Posted at

ふつうはこう書けば20秒立った時にexitする。

setTimeout ->
  console.error 'execution timeout.'
  phantom.exit 10
, 20 * 1000

リソースのロードのタイムアウトはこれ

page.onResourceTimeout = () ->
  console.error 'resource timeout'

js loopで止まらない時はこれ。 Define the new page callback for interrupting a long-running JavaScript · efcc6c7 · ariya/phantomjs

page.onLongRunningScript = () ->

でもけっきょくphantomごと止めちゃうようなのがあるので外側でtimeout監視してkillするひつようあり。

7
7
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
7
7