我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

cURL解析divs来自其他页面的类数据

how to parse data from others website classes? Thats my code:

public function index()
    {            
        $response = Curl::to('http://www.espn.com/nba/game?gameId=400874421')->get();    
        return dd($response);
    } 

In example I need score, what commands will filter the code that the score will only be left?

There are plenty of html parsers that can do this, though I would recommend Symfony DomCrawler Component.

http://symfony.com/doc/current/components/dom_crawler.html

$crawler = new Crawler($html);
$crawler = $crawler->filter('.score-class');

近期文章

  • xml独立标记的简单xml问题
  • 从json结果中提取一位数据
  • PHP / MySQL中的地理搜索(距离)(性能)
  • 更新MySQL数据库中的加密密码
  • 使用PHP将文件上传到路径时出现问题
  • 在PHP中使用GET方法时的SESSION问题
  • 将带有curl的xml字符串发布到Web服务
  • 替代基于Java / Spring的Web服务
  • 拒绝使用.htaccess访问多个.php文件? [重复]
  • Git在命令上使用--work-tree和--git-dir
  • Symfony2 Prototype包含不需要的字段
  • 如果用户已登录,请添加javascript文件
  • 从下拉菜单将数据发送到CSV文件
  • 从查询字符串php中删除加号
  • 不能让跨浏览器的AJAX请求工作
  • 如何删除非空目录?
  • 从表单中获取特定信息
  • PHP中构造函数内的全局变量
  • 将必需的列添加到数据库表
  • CSS不适用于php构造的表单

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华