donglu2761 2014-12-18 09:39
浏览 54
已采纳

如何使用php抓取基于javascript和ajax的网页数据

I want to create a simple crawler using php for crawling a specific content of vodafone website.

I want to crawl the content from https://shop.vodafone.in/shop/rechargeOnline.jsp?cid=mum . In that,

View All Recharge->Bonus Card 5->Detals.

After clicking "Details" button, pop up window will appear. I want to extract whole data in the pop up window.

I'm able to extract static content. but the data in the pop up is depending of javascript and ajax call.

Somebody help me to get out of this problem.

  • 写回答

1条回答 默认 最新

  • douzong5473 2014-12-18 09:47
    关注

    PHP doesn't render JS, so you can't do what you are asking.

    But, that page is making a request which you can directly read. It's making a request to: https://shop.vodafone.in/shop/ajax/viewRechargeDetails.jsp?id=sku4760065

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器