好日子。如何從遠程URL獲取HTML?
我有這個link
如果我在blowser打開鏈接,我看到窗口
我想獲取HTML ID爲TarifValue元素
爲了這個,我使用代碼:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.russianpost.ru/autotarif/Autotarif.aspx?viewPost=26&countryCode=643&typePost=1&viewPostName=undefined&countryCodeName=%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D0%B9%D1%81%D0%BA%D0%B0%D1%8F%20%D0%A4%D0%B5%D0%B4%D0%B5%D1%80%D0%B0%D1%86%D0%B8%D1%8F&typePostName=undefined&weight=1100&value1=2650&postOfficeId=123456');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
curl_close($ch);
但echo $output
顯示下面的代碼:
<html>
<head></head>
<body onload="document.myform.submit();">
<form method="post" name="myform" style="visibility:hidden;"><input id="key" name="key" value="497947">
<input type="submit">
</form>
</body>
</html>
請告訴我如何分辯獲取HTML當我需要?
對不起,我不添加插入代碼,請查看我的答案,請在單詞之後,但'echo $ output顯示下一個代碼:' –