简体   繁体   English

删除动态内容PHP

[英]Scrape Dynamic Content PHP

i am trying to scrape this page . 我正在尝试刮擦此页面 I want to get statistics part of image. 我想获取图像的统计信息部分。 when you will click on "Info Button " , then you can see it's information and all stuff. 当您单击“信息按钮”时,您可以看到其信息和所有内容。 Statistic part is generate dynamically . 统计部分是动态生成的。 i have got all static part but i am not able to get dynamic part. 我有所有静态部分,但我无法得到动态部分。 suggestions or code will be very helpful. 建议或代码将非常有帮助。

Here is my code to get static content: 这是我获取静态内容的代码:

  $data = file_get_contents('https://www.pexels.com/photo/person-in-front-of-laptop-on-brown-wooden-table-2115217/');
  print_r($data) 

NOTE : They provide API service as well but as much i have read them they are not allowing access to image Statistics part. 注意:它们也提供API服务,但由于我已阅读过多,因此它们不允许访问图像统计部分。 so what i am planing is to . 所以我打算要。

  1. Call API and get Search result. 调用API并获取搜索结果。
  2. Get all Images URL from result and scrape statistic part from there . 从结果中获取所有图片URL,然后从中获取统计信息部分。

When you click the Info button new ajax call occurs. 单击“ Info按钮时,将发生新的ajax调用。

You can see that in dev tools (inspect) -> network tab 您可以在dev tools (inspect) -> network tab看到

And this is the requested url: https://www.pexels.com/medium/below-the-fold-photo-stats/2115217/ 这是请求的网址: https : //www.pexels.com/medium/below-the-fold-photo-stats/2115217/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM