douhuangjian9627 2017-07-18 06:00
浏览 73
已采纳

如何从php中加载Java脚本的url获取变量?

i have this URL : http://www.tsetmc.com/Loader.aspx?ParTree=151311&i=65883838195688438

i want to get all numeric data from this website .

e.g : 3.797 M

in this page all data refresh immediately.

i try :

$url = 'http://www.tsetmc.com/Loader.aspx?ParTree=151311&i=65883838195688438';
$data = file_get_contents($url);
echo $html_encoded = htmlentities($data);

or :

$url = 'http://www.tsetmc.com/Loader.aspx?ParTree=151311&i=65883838195688438';
echo $data = file_get_contents($url);

but i cant get numeric data .

both methods does not contain numeric data .

  • 写回答

2条回答 默认 最新

  • dongxun2903 2017-07-18 06:31
    关注

    Because the JavaScript generating the page content. All necessary data is in the JavaScript code. Just take a look into page source.

    Piece of code from the source:

    <script type="text/javascript">
    var TradeHistory=[['20170717','2633.00','2577.00','2565.00','2705.00','1679','26095164','68719004798.00'],['20170716','2577.00','2599.00','2550.00','2600.00','840','7655664','19725265524.00'],...
    

    The data comes also from there: IntraDayPrice, instinfofast.aspx

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?