Htmldom icon indicating copy to clipboard operation
Htmldom copied to clipboard

User Agent

Open hojabbr opened this issue 8 years ago • 2 comments

How can I change the user agent?

hojabbr avatar Jul 09 '16 16:07 hojabbr

Add this lines on load_file() method from Htmldom.php

$opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6\r\n". "Cookie: foo=bar\r\n" ) ); $context = stream_context_create($opts); $args[1] = FALSE; $args[2] = $context;

braicauc avatar Aug 19 '16 14:08 braicauc

Anyway without editing the source?

hojabbr avatar Sep 25 '16 07:09 hojabbr