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 我想在一个软件里添加一个优惠弹窗,应该怎么写代码
  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流