Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.lang.javascript > #8220

usare casperjs

Path csiph.com!aioe.org!.POSTED!not-for-mail
From Simonex <simo@sumo.it>
Newsgroups it.comp.lang.javascript
Subject usare casperjs
Date Fri, 8 Sep 2017 10:17:24 +0200
Organization Aioe.org NNTP Server
Lines 34
Message-ID <ootjmk$mub$1@gioia.aioe.org> (permalink)
NNTP-Posting-Host v0B4mMXI2/gUutNXgQ17yw.user.gioia.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-15; format=flowed
Content-Transfer-Encoding 8bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1
X-Notice Filtered by postfilter v. 0.8.2
Content-Language it-IT
X-Mozilla-News-Host news://46.165.242.91:119
Xref csiph.com it.comp.lang.javascript:8220

Show key headers only | View raw


Premetto che con JS mi cimento da pochissimo tempo, quindi perdonate 
l'inesperienza.

Dunque...

+ cat casper.js
var casper = require('casper').create();

casper.start('http://casperjs.org/');

casper.then(function() {
     this.assertTitle('casper');
     this.echo('First Page: ' + this.getTitle());
});

casper.thenOpen('http://phantomjs.org', function() {
     this.echo('Second Page: ' + this.getTitle());
     this.click('DOCUMENTATION');
     this.clickLabel('DOCUMENTATION');
});

casper.run();



+ casperjs casper.js
TypeError: undefined is not a function (evaluating 
'this.assertTitle('casper')')
Second Page: PhantomJS | PhantomJS
CasperError: Cannot dispatch mousedown event on nonexistent selector: 
DOCUMENTATION


Come vedete ci sono un po' di errori, perchè?

Back to it.comp.lang.javascript | Previous | NextNext in thread | Find similar


Thread

usare casperjs Simonex <simo@sumo.it> - 2017-09-08 10:17 +0200
  Re: usare casperjs Simonex <simo@sumo.it> - 2017-09-11 11:18 +0200

csiph-web