title: Get img src with PHP Simple HTML DOM
body: <p><a href="http://www.tripadvisor.com/Hotel_Review-g274965-d952833-Reviews-Ezera_Maja-Liepaja_Kurzeme_Region.html">Demo</a></p>
  
  <p>I need to get the image src from the following code  </p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div class="avatar profile_CF48B2B4A31B43EC96F0561F498CE6BF "&gt;
      &lt;a onclick=""&gt;
          &lt;img id="lazyload_-247847544_0" height="74" width="74" class="avatar potentialFacebookAvatar avatarGUID:CF48B2B4A31B43EC96F0561F498CE6BF" src="http://media-cdn.tripadvisor.com/media/photo-l/05/f3/67/c3/lilrazzy.jpg" /&gt;
      &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I tried writing the <strong>js</strong>: </p>
  
  <pre><code>foreach($html-&gt;find('div[class=profile_CF48B2B4A31B43EC96F0561F498CE6BF] a img') as $element) {
      $img = $element-&gt;getAttribute('src');
      echo $img;
  }
  </code></pre>
  
  <p>But it shows src key doesn't exists. How can I scrap review avatar images?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>The image url is not found when I looked at the page source, But <strong>firebug</strong> shows the image url:</p>
  
  <p><code>&lt;img id='lazyload_1953171323_17' height='24' alt='4 helpful votes' width='25' class='icon lazy'/&gt;</code></p>
  
  <p>Here is my page's <strong>source</strong> code:</p>
  
  <pre><code>&lt;div class="col1of2"&gt;
  &lt;div class="member_info"&gt;
  &lt;div id="UID_3E0FAF58557D3375508A9E5D9A7BD42F-SRC_175428572" class="memberOverlayLink" onmouseover="ta.trackEventOnPage('Reviews','show_reviewer_info_window','user_name_photo'); ta.call('ta.overlays.Factory.memberOverlayWOffset', event, this, 's3 dg rgba_gry update2012', 0, (new Element(this)).getElement('.avatar')&amp;&amp;(new Element(this)).getElement('.avatar').getStyle('border-radius')=='100%'?-10:0);"&gt;
  &lt;div class="avatar profile_3E0FAF58557D3375508A9E5D9A7BD42F "&gt;
  &lt;a onclick=&gt;
  &lt;img id='lazyload_1953171323_15' height='74' width='74' class='avatar potentialFacebookAvatar avatarGUID:3E0FAF58557D3375508A9E5D9A7BD42F'/&gt;
  &lt;/a&gt;
  &lt;/div&gt;
  &lt;div class="username mo"&gt;
  &lt;span class="expand_inline scrname hvrIE6 mbrName_3E0FAF58557D3375508A9E5D9A7BD42F" onclick="ta.trackEventOnPage('Reviews', 'show_reviewer_info_window', 'user_name_name_click')"&gt;Prataspeles&lt;/span&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="location"&gt;
  Latvia
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="memberBadging"&gt;
  &lt;div id="UID_3E0FAF58557D3375508A9E5D9A7BD42F-CONT" class="totalReviewBadge badge no_cpu" onclick="ta.trackEventOnPage('Reviews','show_reviewer_info_window','review_count'); ta.util.cookie.setPIDCookie('15984'); ta.call('ta.overlays.Factory.memberOverlayWOffset', event, this, 's3 dg rgba_gry update2012', -10, -50);"&gt;
  &lt;div class="reviewerTitle"&gt;Reviewer&lt;/div&gt;
  &lt;img id='lazyload_1953171323_16' height='24' alt='4 reviews' width='25' class='icon lazy'/&gt;
  &lt;span class="badgeText"&gt;4 reviews&lt;/span&gt;
  &lt;/div&gt;
  &lt;div id="UID_3E0FAF58557D3375508A9E5D9A7BD42F-HV" class="helpfulVotesBadge badge no_cpu" onclick="ta.trackEventOnPage('Reviews','show_reviewer_info_window','helpful_count'); ta.util.cookie.setPIDCookie('15983'); ta.call('ta.overlays.Factory.memberOverlayWOffset', event, this, 's3 dg rgba_gry update2012', -22, -50);"&gt;
  &lt;img id='lazyload_1953171323_17' height='24' alt='4 helpful votes' width='25' class='icon lazy'/&gt;
  &lt;span class="badgeText"&gt;4 helpful votes&lt;/span&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p>Is there any problem because of using lazyload?</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>Using lazyload makes my images load once the pages are loaded, i tried getting image ids and compare them with the <strong>lazyload js</strong> array, but this id doesn't match with the <strong>lazyload var</strong> array.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>How to get this js array from this <strong>JSON</strong>?</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>{"id":"lazyload_-205858383_0","tagType":"img","scroll":true,"priority":100,"data":"http://media-cdn.tripadvisor.com/media/photo-l/05/f3/67/c3/lilrazzy.jpg"}
  ,   {"id":"lazyload_-205858383_1","tagType":"img","scroll":true,"priority":100,"data":"http://c1.tacdn.com/img2/icons/gray_flag.png"}
  ,   {"id":"lazyload_-205858383_2","tagType":"img","scroll":true,"priority":100,"data":"http://media-cdn.tripadvisor.com/media/photo-l/01/2a/fd/98/avatar.jpg"}
  ,   {"id":"lazyload_-205858383_3","tagType":"img","scroll":true,"priority":100,"data":"http://c1.tacdn.com/img2/icons/gray_flag.png"}
  ,   {"id":"lazyload_-205858383_4","tagType":"img","scroll":true,"priority":100,"data":"http://media-cdn.tripadvisor.com/media/photo-l/01/2e/70/5e/avatar036.jpg"}
  ,   {"id":"lazyload_-205858383_5","tagType":"img","scroll":false,"priority":100,"data":"http://c1.tacdn.com/img2/badges/badge_helpful.png"}
  </code></pre>