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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.