php-phantomjs icon indicating copy to clipboard operation
php-phantomjs copied to clipboard

UserAgent

Open NightAlexNow opened this issue 10 years ago • 5 comments

How i may set "useragent" in php-phantomjs?

NightAlexNow avatar Feb 07 '15 10:02 NightAlexNow

You can add it by setting the userAgent in your PhantomJS script:

page.settings.userAgent = 'YourUserAgent';

This is not currently supported in this library but will add it to the list for V4.

jonnnnyw avatar Feb 17 '15 14:02 jonnnnyw

will add if you library simulate a click on a page element and receiving the resulting page?

NightAlexNow avatar Feb 21 '15 07:02 NightAlexNow

If you want DOM navigation you're probably better to look into the Symfony DOM crawler library - http://symfony.com/doc/current/components/dom_crawler.html

jonnnnyw avatar Mar 21 '15 07:03 jonnnnyw

It is supported in V4?

terrylinooo avatar Jan 11 '17 08:01 terrylinooo

you havent added it to the docs. Now I cannot spoof it into thinking im running on chrome so that youtube videos load

EthanSK avatar Jul 02 '17 15:07 EthanSK