Sorry for bad english. So i want to scrap some content from the website, but the div classes are nested and confusing me.
Basically the structure is :
<div id="gsc_vcd_table">
<div class="gs_scl">
<div class="gsc_vcd_field">
Pengarang
</div>
<div class="gsc_vcd_value">
I Anggara Wijaya, Djoko Budiyanto Setyohadi
</div>
</div>
<div class="gs_scl">
<div class="gsc_vcd_field">
Tanggal Terbit
</div>
<div class="gsc_vcd_value">
2017/3/1
</div>
</div>
</div>
I want to get text I Anggara Wijaya, Djoko Budiyanto Setyohadi from Pengarang field and also get 2017/3/1 from Tanggal Terbit field.
$crawlerdetail=$client->request('GET',$detail);
$detailscholar=$crawlerdetail->filter('div.gsc_vcd_table');
foreach ($detailscholar as $key)
{
$keyCrawler=new Crawler($key);
$pengarang=($scCrawler->filter('div.gsc_vcd_value')->count()) ? $scCrawler->filter('div.gsc_vcd_value')->text() : '';
echo $pengarang;
}
Help me please.