Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
294 views
in Technique[技术] by (71.8m points)

php - How to change Wamp64's browsing language?

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
...