Skip to content
This repository has been archived by the owner on Mar 26, 2022. It is now read-only.

User Agent #15

Open
hojabbr opened this issue Jul 9, 2016 · 2 comments
Open

User Agent #15

hojabbr opened this issue Jul 9, 2016 · 2 comments

Comments

@hojabbr
Copy link

hojabbr commented Jul 9, 2016

How can I change the user agent?

@braicauc
Copy link

braicauc commented Aug 19, 2016

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;

@hojabbr
Copy link
Author

hojabbr commented Sep 25, 2016

Anyway without editing the source?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants