【发布时间】:2015-05-23 19:05:20
【问题描述】:
我一直在尝试在速卖通中使用 file_get_html(),但出现错误。
当我尝试使用以下内容时,一切正常:
$url = "http://pt.aliexpress.com/br_home.htm";
$retorno = file_get_html($url);
当我尝试使用它时,一切都崩溃了:
$url = "http://pt.aliexpress.com/item/2015-Hot-Men-s-Fashion-Casual-Slim-Fit-Suit-Jacket-Solid-Color-High-Quality-Masculine-Blazer/32272100970.html?s=p";
$retorno = file_get_html($url);
我得到了错误:Warning: file_get_contents(http://pt.aliexpress.com/item/2015-Hot-Men-s-Fashion-Casual-Slim-Fit-Suit-Jacket-Solid-Color-High-Quality-Masculine-Blazer/32272100970.html?s=p): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /Users/nando/htdocs/aliex/public/simple_html_dom.php on line 75
我不知道为什么第一个 URL 正常,而第二个我不能使用。
如果有人可以帮助我,我会很高兴。谢谢。
【问题讨论】:
-
改用 curl() 函数
-
你有什么例子吗?感谢您的回复。
-
检查答案。谢谢
-
不知道为什么我被否决了。
标签: php html url file-get-contents