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

Nesting casper.js actions in a loop

I'm trying to nest casper.then() actions in a while loop. However, It seems that the script never executes the code inside those casper.then() functions. Here's my code casper.then(function() { while (this.exists(x('//a[text()="Page…
0
votes
1 answer

Asynchronous recursion handling and event delegation in CasperJS

I'm attempting to run an automated job with CasperJS which brings in a JSON file and checks if certain elements on a given page declared in each JSON object exist. I am attempting to write this recursively, but I am running in to an issue where the…
Tyler Brown
  • 158
  • 3
  • 16
0
votes
1 answer

FB Messenger Bot with NodeJS webhook + CasperJS

I followed FB's tutorial to make a FB messenger bot. The webhook is made successfully, I now want to move forward to capture Facebook user's input (the message that sends to my page), and use it as an input to my CasperJS script. Last, I would like…
Raptor
  • 53,206
  • 45
  • 230
  • 366
0
votes
0 answers

Casperjs: “TypeError: casper.on is not a function”

My code is very simple: let casper = require('casper').create({ pageSettings: { loadImages: false, loadPlugins: false, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.4 (KHTML, like Gecko)…
Eduardo Cuomo
  • 17,828
  • 6
  • 117
  • 94
0
votes
1 answer

How to select the option with specific value or content in the iframe with CasperJS?

I am crawling with CasperJS, but I need to click something to finish the search process of the page at first. But I cannot select the spcific option by its value or its content. 1.Once click the button "All" in the parent frame:
Jeffy
  • 121
  • 1
  • 2
  • 10
0
votes
2 answers

Submit a form using Casperjs

I have tried various methods in casperJS to fill in and submit a form. The code is shown below. Ultimately I am building a robot to automatically check the status of a cargo airwaybills on the IAG Cargo web portal. Sendkeys will complete the form…
Malcolmf
  • 75
  • 8
0
votes
1 answer

casperjs screenshot returning blank square boxes. Please tell me possible solution to get the character instead of boxes

I am using CasperJS 1.1.0 with PhantomJs 2.0. I am using Linux server. I have a script, trying to run and take screenshots. This screenshot is fine for local server nor for live. Screenshot of the site will look like…
0
votes
0 answers

How to create synchronous call in casperjs

I have code something like below function main() { casper.start(); status = "A"; while(true){ if(status == "C"){ casper.then(function(){ status = "stop"; // the value status is stop in second loop }); }else{ …
Rohit Ramani
  • 776
  • 7
  • 15
0
votes
1 answer

How to handle unlimited scrolling/dynamic loading with CasperJS (PhantomJS) on Twitter

Trying to handle unlimited scrolling on Twitter, page doesn't seem to be loading dynamic content even though I'm scrolling to the bottom. I'm doing a quick test to see if content even loads with the following…
PGT
  • 1,468
  • 20
  • 34
0
votes
1 answer

How to remove division by casperjs

Please suggest me, how to remove division. i am wring bellow code for scraping but that is not working for remove division. I have used javascript and jquery to remove the div but its not working on casperjs . SO I want the solution in casperjs to…
0
votes
1 answer

CasperJS crashes - can they be avoided with refresh or reinstance?

hope you're having an awesome day. I'm running a CasperJS scrape across around 100,000 links over the course of a few days (continuously). For every 500 or so, casperJS crashes randomly. When reloaded and started from the last link, however, it…
jakequade
  • 45
  • 1
  • 8
0
votes
1 answer

CasperJS hangs when processing big numerical loops

Even on a simple code, CasperJS seems to hang when presented with a big iteration number, for example: function urlCheck(url) { // Thing to do with url } casper.start('https://www.exampleAPI.com', function() { console.log('Booted up…
jakequade
  • 45
  • 1
  • 8
0
votes
1 answer

CasperJS : clickLabel not working

I have a simple link I want to follow next (Page-2 increments) I am trying to follow the next button using clickLabel, but I cant seem to get it to work. It seems to go to the next page then die var casper =…
Burf2000
  • 5,001
  • 14
  • 58
  • 117
0
votes
0 answers

How to find multiple elements on headless browser and click them after a timeout

I want to detect elements in the DOM without a specific child, and then click the ones without the child after a timeout. There is no way to explicitly and directly find the elements only get all elements with a certain class, and omit the ones with…
PGT
  • 1,468
  • 20
  • 34
0
votes
0 answers

Convert cloudflare-challenge.js from phantomjs to casperjs

I want to convert cloudflare-challenge.js https://gist.github.com/antoligy/f4f084b87946f84a89b4 From working on phantomjs to working on casperjs with phantomjs phantomjs cf.js…
ezak
  • 133
  • 1
  • 1
  • 9
1 2 3
99
100