Jump to content

simple html parser help


dflow

Recommended Posts

im using  simple_html_dom.php

 

i want to extract the following html:

and number the array key so i will know the location of each <td> and extract the value there:

this cell:

<TD ALIGN=RIGHT NOWRAP  class="ftableline1">

3.7200

</TD>

with this :

foreach($html->find('td[class=ftableline1]') as $e)
    echo $e->innertext . '<br>';

<TR class="ftableline1">

										    

										   
		    
			<TD ALIGN=RIGHT NOWRAP  class="ftableline1">
				3.7200
				</TD>
			<TD ALIGN=RIGHT NOWRAP  class="ftableline1">

				3.5400

			</TD>
			<TD ALIGN=RIGHT NOWRAP  class="ftableline1">
				3.6651
				</TD>

			<TD ALIGN=RIGHT NOWRAP  class="ftableline1">

				3.5982

			</TD>
			<TD align="right" NOWRAP  class="ftableline1">

				<A HREF=_matbea=1><IMG SRC="images/tezuga_graphit.gif" WIDTH=15 HEIGHT=15 ALT="Show Graph" BORDER="0"></a><BR>

			</TD>
			<TD ALIGN=RIGHT NOWRAP>0.01%</TD>
			<TD ALIGN=right dir="rtl">

				<IMG SRC="images/arrow_up.gif" WIDTH=10 HEIGHT=8 BORDER=0><BR>


			</TD>
			<TD align="right" NOWRAP dir="rtl" class="ftableline1"> 

				3.6316

			</TD>
			<TD align="right" NOWRAP dir="rtl" class="ftableline1"> 

				1

			</TD>
			<TD ALIGN=RIGHT NOWRAP dir="rtl" class="ftableline1">

				<A HREF=_matbea=1>       דולר ארה"ב</A><BR>

			</TD>

			<TD align="right" NOWRAP dir="rtl" class="ftableline1">

				<A href="_matbea=1"><IMG SRC="../../meida/images/f1.gif" HEIGHT=15 WIDTH=21 border=0></A><BR>

			</TD>
			<TD ALIGN=center NOWRAP dir="rtl"><INPUT TYPE="Checkbox" VALUE="1" NAME="check" id="check" ></TD>

		</TR>

Link to comment
https://forums.phpfreaks.com/topic/221034-simple-html-parser-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.