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条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?