0

我有代码,我需要它来获取包含以下内容的 csv 文件。

img.myImg 的源文件;EAN内容:Z88799010290

我试过了,但没有运气如何合并两个 foreach:

foreach($html->find('img.myImg') as $e)
    echo $e->src . '<br>;';

foreach($html->find('div.EANN') as $ean)
    echo $ean. ';<br>';
4

1 回答 1

0
<div id="wybr_45" alt="-8204" class="listProduct"><div id="d4b">

<div class="fl fotoimage">
    <div class="listLink1"> <a href="#" onclick="changeData('popshop','Mainframe','showModuleNew','DeepProductSelect',1234,1234);" >
   <img src="http://example/script.php?a=87x112&amp;t=B2B.BSDTrade&amp;i=-441"  class="myImg" alt="w"/> </a>
  </div>

</div>


<div class="fl descriptionColumn">

<div class="lpTitle2 listName"><b> <a href="#">GATTA: MICHELLE LOVE pończochy samonośne wz.03</a></b></div>
<div class="lpTitle2"><!-- <a href="#" >brak opisu </a> --></div>
<span class="lpTitle2">Kod:</span><b>-8204</b>
<div class="EANN">000245035190</div><div class="lpTitle2 producer">Producent: <a style="font-size: 12px; color: #555;" href="#">GATTA</a></div>

</div>

<div class="marketIndex">
<div class="priceColumn"> <span class="oldPrice1"> 
</span></div>
<div class="OrderCpl"><span class="addtoOrderL" onclick="deepProductTable_showForProduct(-8204);" >

<span onclick="deepProductTable_showForProduct(-8204);" class="addtobasket"/> </span></div>
</div></div></div>

结果:

http://example/script.php?a=87x112&amp;t=B2B.BSDTrade&amp;i=-723;000937090290
于 2012-07-26T22:36:14.810 回答