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 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动