B
B
bmot2017-07-17 16:47:33
HTML
bmot, 2017-07-17 16:47:33

Why isn't phantomJS loading the page to the end?

Using phantomjs I download the page, but it does not come complete, what is my mistake?

var page = require('webpage').create(),
  system = require('system'),
    url = system.args[1];

page.open (url, function (status) {
  page.injectJs('./jquery.min.js');
  
    if (status !== 'success') {
        console.log('FAIL to load url');
    }
  else {
    var captchaToken = page.evaluate(function() {
      return $("form").html();
    });
    console.log(captchaToken);
  }
  phantom.exit();
});

What should be the result:
9c4d72aa43c945d086c84e352378dec9.PNG
And instead I get an empty block PS I forgot to add that I used both WaitFor and sent it to sleep, but to no avail.
<div id="captcha"></div>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
A person from Kazakhstan, 2019-01-27
@LenovoId

Have you tried inkscape yet?
Look, such show-offs are made there at the click of a finger
5c4db58c069bd491831361.png5c4db845b4497032865180.png

N
Nicholas, 2017-07-17
@healqq

Probably the captcha has not had time to initialize yet. This is probably some kind of script that performs a request to the backend, and then it is already filled with data. In this case, you need to wait until this thing happens. And then get the page.

V
void64rus, 2017-11-28
@void64rus

Either hardcore timeout or sniffer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question