Z
Z
Zimaell2019-08-07 18:58:31
PHP
Zimaell, 2019-08-07 18:58:31

How to properly use PhantomJS on Amazon?

Until recently, the script for buying goods using PhantomJS merlinthemagic worked, here is an example of logging in

require('/vendor/autoload.php');
$browserObj=\MTS\Factories::getDevices()->getLocalHost()->getBrowser('phantomjs');
$browserObj->setKeepalive(true);
$windowObj=$browserObj->getNewWindow();
$windowObj->setUserAgent('Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36');
$windowObj->setUrl($url_login);
$content=$windowObj->getDom();
$windowObj->mouseEventOnElement("[id=ap_email]","leftclick");
$windowObj->sendKeyPresses($email);
$windowObj->mouseEventOnElement("[id=ap_password]","leftclick");
$windowObj->sendKeyPresses($password);
$windowObj->mouseEventOnElement("[id=signInSubmit]","leftclick");
$content=$windowObj->getDom();
$browserObj->terminate();
echo $content;

He worked for a couple of months, then stopped, Amazon started throwing captchas when logging in, even if he solves them, he throws new captchas.
Tell me who faced this problem, how can I solve it?
Just here they wrote that this topic was raised, can anyone tell me what to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
Xveeder, 2019-08-08
@Xveeder

What does Amazon give as a login response?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question