抓取 IMDB 的前 250 名列表会给出一些外语结果吗?

发布于 2024-10-09 13:19:53 字数 353 浏览 0 评论 0原文

我让我的服务器抓取此页面来下载我正在进行的电影分析的完整列表: http://www.imdb.com/chart/top

但是当它做了很多电影标题以另一种语言出现。例如,它没有说《肖申克的救赎》,而是给了我: Побег из Шоушенка

PHP 中的简单 file_get_contents 是最快的重现方法,尽管我使用的是 curl

任何人对发生的事情有任何想法,如何解决?

更新:由于某些奇怪的原因,IMDB 可能会将我的服务器解释为位于另一个国家/地区。有什么办法可以强制执行在美国的规定吗?

I'm having my server grab this page to download the full list for a movie analysis I'm doing:
http://www.imdb.com/chart/top

But when it does a lot of the movie titles are appearing in another language. For example instead of saying The Shawshank Redemption it's giving me: Побег из Шоушенка

A simple file_get_contents in PHP is the fastest way to reproduce, though I'm using curl

Anyone have any ideas for what's going on, how to fix?

UPDATE: IMDB might be interpreting my server as being in another country for some strange reason. Is there any way to enforce it as being in the US?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

没有伤那来痛 2024-10-16 13:19:53

使用用户帐户并设置标题显示语言:https://secure.imdb.com/register-imdb /siteprefs

然后在您的抓取工具中自动执行登录过程并遵循正常流程。

Use an user account and Set title display language at https://secure.imdb.com/register-imdb/siteprefs

Then automate the login process within your scraper and follow your normal process.

断念 2024-10-16 13:19:53

我知道如何在Windows环境下处理这个问题。您可以为您的服务器操作系统借用相同的想法。

在带有WebBrowser控件的Windows中,可以使用菜单View ->编码以选择正确显示文本的任何语言,然后当您从浏览器控件获取源页面时,它将采用正确的编码。

您可能会发现 IRobotSoft 网络抓取工具易于用于电影分析,它仅在 Windows 平台上运行。

I know how to deal with this in the Windows environment. You may borrow the same idea for your server OS.

In Windows with a WebBrowser control, you can use menu View -> Encoding to select whatever language that shows the text properly, then when you grab the source page from the browser control, it will be in the correct coding.

You may find the IRobotSoft web scraper easy to use for your movie analysis, which runs in Windows platform only.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文