Htmldom
Htmldom copied to clipboard
User Agent
How can I change the user agent?
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;
Anyway without editing the source?