Z
Z
Zimaell2019-08-07 20:32:43
PHP
Zimaell, 2019-08-07 20:32:43

How to set Header and cookies in PhantomJS?

Is it possible and if so how to set Header and cookies in PhantomJS, here is a code example of how I make a request

$browserObj=\MTS\Factories::getDevices()->getLocalHost()->getBrowser('phantomjs');
$browserObj->setKeepalive(true);
$windowObj=$browserObj->getNewWindow();
$windowObj->setUserAgent($user_agent);
$windowObj->setUrl($url);
$content=$windowObj->getDom();

Is it possible to somehow send Header and cookies in this example?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daria Motorina, 2019-08-07
@Zimaell

The off-doc says how to network headers and cookies

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question