【发布时间】:2015-12-16 01:41:37
【问题描述】:
我正在尝试使用 file_get_contents 从 roblox 网站获取数据。我正在尝试访问查找用户页面:http://www.roblox.com/search/users?keyword=
当我请求页面时,我提供了 1 个名为 username=[name] 的参数。但是,一旦我尝试加载页面,就没有返回任何结果。
我尝试了 file_get_contents、domdocument、curl。没有任何效果。我不知道该怎么办了。
<?php
$User = $_GET["username"];
$Result = file_get_contents("http://www.roblox.com/search/users?keyword=".$User);
var_dump($Result);
?>
我没有收到任何错误。只是 chrome 连接超时错误。
【问题讨论】:
-
"没有返回结果" - 意思是你得到一个 blank 页面?
-
当我尝试输出结果时,什么都没有显示。
-
你的第一个参数是username还是keyword?因为它看起来像关键字。
-
我使用参数用户名调用这个 php 页面。我将该值作为参数关键字添加到 roblox 页面:testformywebsites.site50.net/Processors/…
-
它有效。更仔细地查看响应。它不是空的。看起来他们最终可能会混淆。爱我一些 ASCII 艺术 :) 他们可能提供 API?见:en.help.roblox.com/hc/en-us/articles/…
标签: php