I work on a project where I am crawling web pages using PHP and Wamp64.
When I am loading a page from an URL using PHP, I get the content of the page in french and I would like to get it in english.
The default browser of Wamp is chrome (the one that I am using) and wamp and chrome are set in english.
When I browse the URL myself the page is in english but when I load it using PHP and Wamp I still get the content of the page in french.
This is the method I'm using to crawl a page :
$search = 'a movie title';
$urlImdb = 'http://www.imdb.com';
$url = $urlImdb.'/search/title/?title='.urlencode(strtolower($search)).'&title_type=feature,tv_movie,tv_series,&view=advanced';
$dom = new DOMDocument();
libxml_use_internal_errors(true);
$dom->loadHTMLFile($url);
$main = $dom->getElementById('main');
// manipulating the dom to get the content I'm looking for
Hope someone can help me with this problem. Thanks.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…