cURL 経由で YQL を呼び出そうとすると、次のエラーが発生します。
サポートされていない HTTP バージョン 説明: Web サーバー "engine1.yql.vip.bf1.yahoo.com" は、サポートされていないバージョンの HTTP プロトコルを使用しています。
以下は使用されたコードです
// URL
$URL = "https://query.yahooapis.com/v1/public/yql?q=select * from html where url=\"http://www.infibeam.com/Books/search?q=9788179917558\" and xpath=\"//span[@class='infiPrice amount price']/text()\"&format=json";
// set url
curl_setopt($ch, CURLOPT_URL, $URL);
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);
echo $output;
?>
ブラウザから同じ URL を呼び出しても問題なく動作する
https://query.yahooapis.com/v1/public/yql?q=select * html where url="http://www.infibeam.com/Books/search?q=9788179917558" and xpath="// span[@class='infiPrice 金額']/text()"&format=json
誰かがコードのどこが間違っているか教えてもらえますか?