Answer the question
In order to leave comments, you need to log in
Clicking on vk.com via casperjs doesn't work, what's wrong?
Good afternoon!
I'm trying a fairly simple operation - changing the notification settings for the mail for the VKontakte account via casperJS, the following code (fragment):
casper.open('https://vk.com/settings?act=notify').then( function() {
casper.wait ('5000', function () {
this.clickLabel('Every time', 'a');
this.clickLabel('Don\'t send', 'div');
})
this.capture('vk.png');
Answer the question
In order to leave comments, you need to log in
With such tools, there is usually a problem with timeouts and execution sequence, try to play with timeouts, set a timeout between actions, it should work.
Isn't it necessary to do it Submit
with the "Save" button, etc.?
If not, it means that an HTTP request should be sent immediately when clicked, so with the help of a sniffer like Fiddler, see if it is sent, what answer comes in, what is the problem, actually using a sniffer you can solve the problem without any Casper.js by imitating HTTP requests in any language, and without a sniffer you don’t fully approach the task, you also don’t have general debugging skills (use stacktrace, “hooks” on XMLHttpRequest, etc.), you need to acquire them, then everything will become transparent and will not be so stupid questions, and without them, such programming is also not complete.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question