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
12
votes
1 answer

How to organize casperjs test with es6 modules

Is there a way to use ES6 modules to organise the test for CasperJS, and if not what is the normal way to organise the tests?
Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297
12
votes
1 answer

How to tell CasperJS to loop through a series of pages

I try to make CasperJS achieve the following: Go through a series of pages that are named sequentially by date. On each page, locate a PDF link. Download the PDF. I got some working code, but I don't understand how CasperJS is going through the…
Manu
  • 849
  • 1
  • 8
  • 20
12
votes
4 answers

How can I catch and process the data from the XHR responses using casperjs?

The data on the webpage is displayed dynamically and it seems that checking for every change in the html and extracting the data is a very daunting task and also needs me to use very unreliable XPaths. So I would want to be able to extract the data…
aste123
  • 1,223
  • 4
  • 20
  • 40
12
votes
3 answers

Use a node module from casperjs

Is it possible to install a node module, installed via npm, and then require it from a casperjs script? (I see lots of posts and tools for running casper or phantom from inside node.js, but that is not what I'm trying to do.) The casperjs docs seem…
Darren Cook
  • 27,837
  • 13
  • 117
  • 217
12
votes
2 answers

Casperjs login: Does casperjs manage cookies?

I want my casper to log in and stay logged in during the session. Is it possible? If so, how?
Euphe
  • 3,531
  • 6
  • 39
  • 69
12
votes
3 answers

CasperJs loads json data from a local file

Is there any convenient way to load a local JSON file into a variable with CasperJs? I saw someone suggest to use $.getJSON(filename, function() ...
marsant
  • 1,088
  • 13
  • 30
12
votes
9 answers

How to click a "select option" and then evaluate loaded content with casperjs

I'm trying to crawl the sizes for this product: Link to product The problem: The sizes are loaded after the color of the product is selected. In the product page's source code, I can see that the dropdown has a onchange-method: It clicks the form…
a_b
  • 1,828
  • 5
  • 23
  • 37
11
votes
2 answers

CasperJS : Why does my url change to about:blank when my page is loaded?

I'm a beginner at PhantomJS/CasperJS. I just want to start a session and verify that it's OK. Here's my code: var casper = require('casper').create({ verbose: true, logLevel: 'debug', pageSettings: { loadImages: false, …
Jakshirak
  • 111
  • 1
  • 5
11
votes
3 answers

Error - running spookyjs

I am getting the following error in windows while running spookyjs but code is working in linux. Error events.js:85 throw er; // Unhandled 'error' event ^ Error: spawn casperjs ENOENT at exports._errnoException (util.js:746:11 at…
karthick
  • 5,998
  • 12
  • 52
  • 90
11
votes
1 answer

CasperJS - downloading generated file with no URL

I have been struggling with this one for a while. I am trying to download CSV file generated by Google Adwords "download report" button. I can click the link just fine and see the resource in the background. The problem is that in order to download…
bvrzvm
  • 111
  • 5
11
votes
1 answer

CasperJS bind issue

I'm trying to reach an instagram page, but with no luck. I keep getting the error and a blank screenshot. Error text: TypeError: 'undefined' is not a function (evaluating 'a.createDescriptor.bind(null,t)') Casperjs --version is…
buzdykg
  • 623
  • 6
  • 13
11
votes
1 answer

casperjs download csv file

I am trying to download a csv file(advert report) from a site using the below code. The issue is, it will download the HTML page and not the csv file. I cannot give you the URL as it is behind the login, but it is similar case when you download…
trio
  • 646
  • 2
  • 6
  • 16
11
votes
2 answers

Cannot load url and then, cannot send login parameters

I'm trying to login automatically in tumblr, running the script proposed here but phantomjs only shows failed attempts: [info] [phantom] Starting... [info] [phantom] Running suite: 3 steps [debug] [phantom] opening url: https://tumblr.com/login,…
Julian
  • 113
  • 1
  • 4
11
votes
1 answer

screenshot of specific dom element using ruby

Is there a way to do this using capybara+phantomjs. Or perhaps something more complex like cropping a full page screenshot to the specific dom element?
user1898961
  • 115
  • 6
11
votes
2 answers

PhantomJS/CasperJS site login, cookies are not accepted by PhantomJS

I recently tried to login into a webiste that forces me to accept cookies. I'm using phantomJs and casperJs. I wrote a little script that should handle the login, but it redirects me to a site that tells me I have to accept cookies. Email and…
Ogofo
  • 356
  • 2
  • 6
  • 13