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.

Filter by
Sorted by
Tagged with
2 votes
0 answers
34 views

Cookies popup stops login to Amazon with CasperJS

Cookies pop-up stops login to Amazon with CasperJS I am trying to write a script using CasperJS to login into my Amazon account. As of now, in 2023, Amazon requires you to input the email first, and ...
0 votes
0 answers
18 views

How to move the mouse with webshot function inside a dygraph widget

I'm stuck because I can not achive what I want with a dygraph widget created in R. I have this time series. #library(xts) dts <- xts::xts(c(10508,8465,3175,3816,4532,2735,2534,9541,8253,9962), ...
0 votes
0 answers
29 views

How do I scrape YouTube with CasperJS?

I try to get access to HTML elements of YouTube. Almost everything below <ytd-app> is not accessible. For example I try to access the description of a YT Video. var casper = require("casper&...
3 votes
0 answers
487 views

Ghost email subscribe is giving “Failed to sign up, please try again” error

I hope you are well. I’m using Ghost 4.33 on DigitalOcean Droplet. The site is running well. I have been editing the Casper theme. Mostly cosmetic updates. I signed u pfor Mailgun and got my email, ...
  • 1,059
0 votes
0 answers
91 views

searchParams not working when called from inside CasperJS code

I would like to update a parameter of a URL so in node JS I have a code that works fine see below: var injectCorrectIndexKey = function (url) { var href = new URL(url); href.searchParams.set('...
  • 182
0 votes
0 answers
36 views

Casper JS returns only first row of a table

I have a table as below: <table id="securedTable" border="1" cellspacing="0" cellpadding="1" class="secured"> <thead> <tr&...
  • 182
-1 votes
2 answers
35 views

Trying to fill table element by id with casperjs

casper.thenEvaluate(function(text){ document.querySelector("#inputValue").value=text }) casper.thenEvaluate seems to not accept the argument and it is filling undefined in the webpage.
0 votes
0 answers
34 views

function this.click dont work on casperjs

there is my code var casper = require('casper').create(); verbose: true; logLevel: 'debug'; pageSettings: { loadImages: true; loadPlugins: true }; ...
1 vote
2 answers
333 views

Difficulties installing casperjs on Mac

After days trying install casperjs on my Mac, i'm asking some help. I first used "brew install" method and NPM, this is terminal's messages : brew install casperjs Updating Homebrew... ==>...
  • 141
1 vote
0 answers
36 views

Casperjs persisting cookies

I'm trying to use CasperJS for HTTP auth to an app then make a second request which if successful should trigger an XSS payload to send the cookies out. I know the auth works as the below code ...
0 votes
1 answer
28 views

casperjs failed to access certain websites that even wget can

A very simple example link https://www.accessdata.fda.gov/scripts/cder/daf/index.cfm. Even wget without any header information can successfully scrape the information. However, casperjs just not work ...
0 votes
0 answers
27 views

CasperJS not scraping paginated data except first

I am trying to scrape this The first page is loading correct but whenever I run the below code, it doesnt give any error and returns data of the first page. I tried several ways but was unable to ...
0 votes
0 answers
40 views

I am new in web scraping using casperjs try to run some example problem but doesn't get the result

So first I try with this code which is available in casperjs example for scraping google search result. but it doesn't work correctly. var links = []; var casper = require('casper').create(); ...
-1 votes
1 answer
114 views

C# WebClient - Getting an HTML from URI instead of CSV from OBIEE

Following this post: C# WebClient - Getting an HTML from URI instead of CSV_ The problem is that the csv was compiled with javascript in the browser. In the same post, recommendation is use Casperjs ...
0 votes
1 answer
471 views

Insert stripe credit card number using casperjs in magento2

I am trying to do a functional test using casperjs in magento 2 at the one step checkout. In this case I have Stripe as a payment gateway and has an iframe with out id or name. (the class name ...
0 votes
1 answer
35 views

How to download image from link direct to save or download button click with CasperJS?

I am trying to download an image with CasperJS. The thing is that I need to download this image from either the click button event or from the direct download link. I have no code yet, so could anyone ...
1 vote
1 answer
64 views

the JS in evaluate function can't been executed

I'm new here.When I try to use casperjs.evaluate() to execute the JS,I find the events were not executed. The code like casper = require("casper").create(); casper.start("https://www.google....
0 votes
1 answer
36 views

Extract text from a DOM element in javascript casperjs

for(var i=0; i < 20; i++) { this.fetchText('div.ma-AdCardMyAds:nth-child('+i+') > div.one > div.two > div.three > span[class="ma-AdCard-price"]')); } There are occasions that before ...
0 votes
1 answer
95 views

How do I inject JS with CasperJS?

could you tell me please how do I inject js into a page with CasperJS? I want this after page has been loaded: inject alert(Hello, World!') or/and inject window.location=stackoverflow.com make ...
0 votes
1 answer
367 views

CasperjJs Can't find variable: fetch

I am writing a simple script that login on website and then go to another page and click button. It seems like it can find button, but there is an error after click: Page Error: ReferenceError: ...
0 votes
1 answer
176 views

How to skip step when the timeout is reached on wait function

How can I prevent the script from stop beign executed when it hits the timeout limit? My code looks like: this.waitForSelector("#my_selector", function(){ //... magic code } , null, 30000) ...
  • 1,446
0 votes
1 answer
266 views

Can't click on element rendered via AJAX

The header content is render via Ajax: <script> $(document).ready(function() { var loadingTimer = setInterval(animate_loading, 66); $.post('home/...
  • 1,446
0 votes
1 answer
65 views

Casperjs does not redirect if there is a 'let' in javascript

For example this is the source of an html page: example.html <html> <head></head> <body> <script> for (let i = 0; i < 10; ++i) { } window.location = '...
0 votes
0 answers
32 views

How to run casperjs code with button in php

I have some casperjs code. When I click button in php. It will run the casperjs code. How can I do it. This is my casperjs code. var casper = require('casper').create({ pageSettings: { ...
0 votes
1 answer
93 views

CasperJS has been redirected and then exited with status=fail (HTTP 302)

CasperJS version 1.1.4 at /opt/casperjs, using phantomjs version 2.1.1. Running on centOS. Trying to get through authentication page which runs on ASP.net webforms, but after submit button click: ...
  • 189
0 votes
0 answers
321 views

Error undefined is not a constructor (evaluating 'require('webpage').create()') when running Casper.js

Dear StackOverflow Users I'm trying to use casper.js and phantomJS to scrape content from a webpage that uses React to render the content I've downloaded casper.js and Phantom.js added the ...
1 vote
0 answers
53 views

Running casper tests in android webview

I have tests written using casperjs for a web application. I also have an android app that encases the application in a webview. I want to be able to run casper tests in the android native ...
  • 2,171
1 vote
1 answer
37 views

How can I deal with asynchronous requests involving modal popups in Casperjs?

Trying to iterate through a list of links that open modal popups, I'm running into an issue with the asynchronous nature of Javascript. I can loop through the links, and I can get Casperjs to click on ...
0 votes
1 answer
305 views

How to setup multiple test env using cypress to test chat app?

Is it possible to setup multiple cypress test runner to test chat apps? If yes, how? I have found on some links there is idea to test it using CasperJS and PhantomJS, but not really sure how to setup.
  • 1,865
1 vote
0 answers
36 views

Download a PDF from JS generated links

I'm trying to download PDF's from a site. The links are being generated by JS and I'm able to collect the URL's. How do I tell my headless browser to click on these links and download the file(s) ? ...
1 vote
1 answer
306 views

Click a link in a table row based on text in that row

I have a table which has multiple rows and a link on the end. I want to click on the link in the row which has the text I'm looking for. Example: <table class="repeater large"> <tbody> ...
1 vote
2 answers
378 views

React web scraping without using a server

There is a way in React to do web scraping without using a server that takes care of this. I would like to use only React. I was trying to use casperjs but it seems to give me problems on react when ...
  • 3,206
-1 votes
1 answer
37 views

While waiting for 5 mint to write in a file every 5sec

When my script stops for a time that I determine, I would like to know how I can do so during that time of 5 mint is writing in a file every 5 sec. It is the only way to know if my script has been ...
0 votes
1 answer
878 views

shell - Pass command line arguments to bash script does not work

I have a .sh script file and specifically the atguments are not going well, and I do not know the reason --engine = slimerjs and - headless #!/bin/bash xterm -e /usr/local/bin/casperjs --engine=...
0 votes
1 answer
186 views

How do I join separate json objects output from a for loop into an array?

I am scraping websites using CasperJS and one of the tasks involve crawling across url set by a for loop counter. The url looks like this www.example.com/page/no= where the no is any number from 0-...
user avatar
1 vote
1 answer
201 views

CasperJS PHP - Caper Script Run Command Failing

I have installed CasperJS wrapper for PHP along with all the required requisites. The package is here: PHP CasperJS I am trying to run the basic script example provided on the github readme page, ...
0 votes
1 answer
102 views

Casper PHP Extension - Errors during installation

Having problems trying to install the extension package for PHP Casper: Casper PHP extension I have installed all the prerequisites: PhantomJS CasperJS Casper PHP wrapper I am just getting an ...
0 votes
1 answer
106 views

How to run external program(exe, bat) withing casperjs script

I have running casperjs program, i want during the script to wait for a few seconds and run exe file. it can be .bat as well. and then read the result from text file. as far as i know my only problem ...
  • 11
1 vote
1 answer
37 views

Setting page and form with casperjs

Hello i need to scrape the result information in my site with browser automation. I have this script: var casper = require('casper').create(); console.log("casper create OK"); casper.start("https://...
0 votes
0 answers
47 views

Capture link tracking in CasperJS

There is google analytics used on the page. One of its functions is to track clicked links. After the link is clicked the GET-request is sent. My code has to register such a request after specific ...
  • 75
0 votes
1 answer
85 views

PhantomJS - wrong language in Google Analytics (Accept-Language)

I'm running some tests with PhantomJS / CasperJS on Ubuntu and Google Analytics, and i'm having problems with GA to correctly recognize my language settings that i'm sending in HTTP Request Headers. ...
0 votes
1 answer
1k views

PhantomJS: Download File from Website with Cloudflare Protection

I have this code and want to Download a File. Parsing the Sourcecode of the Protected site is working fine but the Filedownload doesn´t work. Perhaps anyone can tell me where the error is? "use ...
0 votes
0 answers
34 views

PHP JQuery fetching contents from download dialog

When I go to a URL, the page prompts me to download the file. But using CURL or file_get_contents, it is not returning the content of that download file. Do we have any PHP/jQuery code to run the ...
0 votes
0 answers
38 views

I can't pass variable from text file to evaluate in casper.js how I could solve this

I'm trying to enter a manually a value in a website using evaluate of casper.js but when I view the results of variable is undefined this is my code requestHeader = fs.read('userinput.txt'); ...
  • 13
0 votes
0 answers
34 views

Getting list content via Casper JS

I'm using the CasperJS to grab the list data on the website. I've already finished the part of login and screenshot, I make sure that I am on the page which i want to grab. Here is the list like this ...
0 votes
1 answer
484 views

Getting undefined when trying to retrieve value of the element on the page

I am quite new to JavaScript and not able to get why below code is returning undefined when trying to do console log. casper.getVersionOfDocs = function getVersionOfDocs() { casper.then(function()...
0 votes
1 answer
604 views

Logging into the Amazon SellerCentral with PHP and cURL

I'm trying to find a way to log into the Amazon SellerCentral account via PHP, I fund this script https://github.com/mindevolution/amazonSellerCentralLogin which in theory should work but I'm being ...
0 votes
1 answer
8k views

How to compose docker-compose.yml so i can access deamon's container from php?

I need help with Docker. Lets say I have docker-compose.yml version 3 with Nginx+PHP. How do I add image vitr/casperjs so I can call it from PHP like exec('casperjs --version', $output); ? Any ...
  • 1,233
0 votes
1 answer
27 views

Cannot find module within another function/file

I'm running a casper project and I have two files: The code in main.js is: var casper = require('casper').create(); var aSecondary = require('./secondary.js'); aSecondary.secondaryRun(); The code ...
10 votes
1 answer
12k views

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: ...
  • 9,664

1
2 3 4 5
49