Z
Z
Zimaell2019-08-17 14:28:37
PHP
Zimaell, 2019-08-17 14:28:37

What settings can be set in PhantomJS?

My script starts like this

$browserObj=\MTS\Factories::getDevices()->getLocalHost()->getBrowser('phantomjs');
$browserObj->setKeepalive(true);
$windowObj=$browserObj->getNewWindow();
$windowObj->setUserAgent('Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0)  Firefox/68.0');
$windowObj->setUrl('..............');
$content=$windowObj->getDom();

What other settings can be added that may affect its definition as a browser?
Is it possible (if so, how) and is it necessary to set the header, screen sizes, specify plugins, etc.?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Derepko, 2019-08-17
@xEpozZ

do print_r($_SERVER);
it in a script, open it in a browser and copy it to your config. everything is very simple

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question