Questions tagged [casperjs]

CasperJS is a JavaScript based navigation scripting & testing utility for PhantomJS (WebKit) and SlimerJS (Gecko). See SpookyJS for the use of CasperJS inside of node.js.

Definition:

From the Official Documentation:

CasperJS is an open source navigation scripting & testing utility written in JavaScript for the headless browser and (). It eases the process of defining a full navigation scenario and provides useful high-level functions, methods & syntactic sugar for doing common tasks such as:


Important Links:


Related Tags:

2447 questions
10
votes
1 answer

How can I pause and wait for user input with Puppeteer?

I need to make Puppeteer pause and wait for user input of username and password before continuing. It is a nodejs 8.12.0 app. (async () => { const browser = await puppeteer.launch({headless: false}); const page = await browser.newPage(); …
user938363
  • 9,990
  • 38
  • 137
  • 303
10
votes
2 answers

Cant open https web using Slimerjs, casperjs, phantomjs

This is first time i cant open website using headless browser such: phantomjs, slimerjs or casperjs. I just want to open website. I just create very basic script to open the website and take screenshot. but 3 (three) of them give me blank picture. i…
plonknimbuzz
  • 2,594
  • 2
  • 19
  • 31
10
votes
1 answer

Casperjs script blocked on [phantom] Starting

When i run a casperjs script, my script is blocked on the console message [info] [phantom] Starting... I don't understand why. My script var casper = require('casper').create({ verbose: true, logLevel: 'debug', }); var login =…
Hugo
  • 856
  • 1
  • 10
  • 30
10
votes
1 answer

Casperjs: How can I print http requests and responses?

For debugging purporses I need to see the whole request: headers and data. How can I achieve this?
Euphe
  • 3,531
  • 6
  • 39
  • 69
10
votes
4 answers

How to get casper.js http.status code?

I have simple code below: var casper = require("casper").create({ }), utils = require('utils'), http = require('http'), fs = require('fs'); casper.start(); casper.thenOpen('http://www.yahoo.com/', function() { …
HP.
  • 19,226
  • 53
  • 154
  • 253
10
votes
3 answers

casperjs passing params to evaluate fails

casper.then(function(){ phone_number = '7wqeqwe6'; phone_password = 'Teqweqweqw34'; }); casper.thenEvaluate(function(phone,password)…
narek
  • 1,026
  • 2
  • 12
  • 30
9
votes
2 answers

CasperJS: How do you click on all selected buttons?

I'm trying to use CasperJS as a web scraper, and there's a page with buttons that will load data when clicked. So, I'd like to click all of these buttons first and wait before actually making a query to grab all the necessary data. The problem is…
Vongdarakia
  • 379
  • 1
  • 12
  • 25
9
votes
3 answers

Casperjs iterating over a list of links using casper.each

I am trying to use Casperjs to get a list of links from a page, then open each of those links, and add to an array object a particular type of data from those pages. The problem I am having is with the loop that executes over each of the list…
Laurence
  • 661
  • 7
  • 24
9
votes
0 answers

CasperJS is too slow because of too many navigation requests

As we know we can abort a resource request in CasperJS, like this: casper.on('page.resource.requested', function(requestData, request) { if(/plusone|google\.com|about:blank/.test(requestData.url)){ this.echo("----I can ignore this------"); …
aaron
  • 1,951
  • 3
  • 27
  • 41
9
votes
2 answers

How can I maximize the browser window while running test scripts in casperjs using slimerjs

I'm unable to view the full window while running test scripts in casperjs using slimerjs engine . could any one please help me to increase the mozila browser window size
Srikanth Malyala
  • 941
  • 15
  • 24
9
votes
1 answer

can I view the tests scripts running in casperjs in browser for easy tracking

Hi I'm using jquery & Ajax as a front end in my web application , so I'm working on Automating the test environment using casperjs. because of using jquery - ajax, I'm unable to track the application whether the page is loaded or not and many other…
Srikanth Malyala
  • 941
  • 15
  • 24
9
votes
1 answer

Casperjs/Phantomjs - hangs when loading google plus main page

After successful login I'm trying to navigate to https://plus.google.com/u/0/?tab=wX but casperjs hangs. The last output is: [debug] [phantom] Navigation…
Albert
  • 91
  • 3
9
votes
3 answers

Casperjs catch console.log and console.error

I'am trying to catch site console.log and console.error by casperjs. In the case of console.log I have working code: casper.on('remote.message', function(message) { this.echo('remote message caught: ' + message); }); But I can't figure out how…
Piotr Wu
  • 1,362
  • 3
  • 14
  • 31
9
votes
1 answer

Setting paperSize for PDF printing in Casper

In generating PDFs in Phantom, I can set the paper size like this: page.paperSize = { height: '8.5in', width: '11in', orientation: 'landscape', border: '0.4in' }; then the page.render(output) function generates a PDF properly. In other…
Jeff
  • 939
  • 10
  • 19
9
votes
2 answers

CasperJS passing data back to PHP

CasperJS is being called by PHP using an exec() command. After CasperJS does its work such as retrieving parts of a webpage, how can the retrieved data be returned back to PHP?
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830