1
我想从其他网站页面中动态加载表格数据。 我使用Php和简单的Html Dom搜刮很多搜索后没有找到任何解决方案如何从网页上抓取动态数据?或者有另一种方法可以做到这一点?Scrape Div的内容通过Ajax使用Simple Html动态加载动态
我必须从这个url->https://fantasy.premierleague.com/a/leagues/standings/313/classic刮表数据。
我正在使用下面的代码来做到这一点。
$url = "https://fantasy.premierleague.com/a/leagues/standings/313/classic";
$html = file_get_html($url);
$html->find('div#ismr-classic-standings');
foreach($html->find('table.ism-table--standings tr') as $row){
//But count($row)=0 due to late loading html in table.
}
尽管表格的数据是动态的,但DOM结构应该是相同的。它是一样的吗?如果是这样,那么你可以通过使用它的类或html DOM结构来查找。你可以添加一些代码,以便我们更好地理解。 –
添加一些代码或示例,以便我们可以走得更远! –
你好,@Mit.agile代码加上 –