i have this html from stagram :
<div id="photo351321902758808423_176859145" class="photoeach">
<div class="photoeachinner">
<div class="left">
<div class="photowrapper">
<div class="infomation_box clearfix">
<div class="profimage_small">
<div id="photo351295515670923844_176859145" class="photoeach">
<div class="photoeachinner">
<div class="left">
<div class="photowrapper">
<div class="infomation_box clearfix">
i need find class photoeach and extract id 352034826703915686_176859145
i did with regex but no luck , so im trying do it with domdocument
i followed step from Getting DOM elements by classname
$dom = new DomDocument();
$dom->load($filePath);
$finder = new DomXPath($dom);
$classname="photoeach";
$nodes = $finder->query("//*[contains(@class, '$classname')]");
but i cant firgure it out how i can extract ID