Open ghinozzi opened 6 years ago
HTML
<div class='post-start'> <div class='post'><span>POST 1</span></div> <div class='coment'><span>Coment 1</span></div> <div class='coment'><span>Coment 2</span></div> <div class='coment'><span>Coment 3</span></div> </div> <div class=''post-start'> <div class='post'><span>POST 2</span></div> <div class='coment'><span>Coment 1</span></div> <div class='coment'><span>Coment 2</span></div> <div class='coment'><span>Coment 3</span></div> </div> <div class=''post-start'> <div class='post'><span>POST 3</span></div> <div class='coment'><span>Coment 1</span></div> <div class='coment'><span>Coment 2</span></div> <div class='coment'><span>Coment 3</span></div> </div>
PHP
$crawler = GoutteFacade::request('GET', $link); $posts = $crawler->filter('.post-start')->each(function ($node) { how to filter the coments and text of post }
i need constroy one array with posts and coments
$posts = array('title'=>"POST1",'coments'=>array coment);
Did u solve this?
HTML
PHP
$crawler = GoutteFacade::request('GET', $link); $posts = $crawler->filter('.post-start')->each(function ($node) { how to filter the coments and text of post }
i need constroy one array with posts and coments
$posts = array('title'=>"POST1",'coments'=>array coment);