Answer the question
In order to leave comments, you need to log in
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;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question