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 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂