我遇到了file_get_contents问题。我需要从此网址获取内容:http://steamcommunity.com/market/priceoverview/?currency=1&appid=730&market_hash_name=P250%20|%20Valence%20(Field-Tested)
当我用我的浏览器,我的PHP脚本打开它时,效果很好:
$item = "P250 | Valence (Field-Tested)";
$link = 'http://steamcommunity.com/market/priceoverview/?currency=1&appid=730&market_hash_name='.urlencode($item);
echo file_get_contents($link);
把这个错误扔给我:
Warning: file_get_contents(http://steamcommunity.com/market/priceoverview/?currency=1&appid=730&market_hash_name=P250+%7C+Valence+%28Field-Tested%29): failed to open stream: HTTP request failed! HTTP/1.0 429 Unknown
答案 0 :(得分:0)
根据错误消息,您从Steam的服务器收到<!DOCTYPE html>
<html>
<head>
<title> Drawing Canvas</title>
<link rel='stylesheet' type="text/css" href = 'drawingMain.css'>
</head>
<body>
<div id = 'container'>
<div id='body'>
<h1 class = 'heading'> Welcome to a Drawing Canvas!!</h1>
<canvas id ='drawing' >
A sample drawing <! this will be shown if canvas doesnt work in the browser !>
</canvas>
</div>
<div id ='clearBtnDiv'>
<input type="submit" value="Clear" id ='clearBtn' > </div>
</div>
<script type="text/javascript" src= 'drawing.js'> </script>
</body>
</html>
HTTP错误:
429