get text from a certain <tr> tag

Posted by WideBlade on Stack Overflow See other posts from Stack Overflow or by WideBlade
Published on 2011-01-06T23:43:20Z Indexed on 2011/01/06 23:53 UTC
Read the original article Hit count: 197

Filed under:
|

Is there a way to get the text in a dynamic way from a certain <tr> tag in the page?

e.g. I've a page with a <tr> with the value "a1". I'd like to get only the text from this <tr> tag, and echo it into the page. is this possible?

here is the HTML:

<html><tr  id='ieconn2' >
  <td><table width='100%'><tr><td valign='top'><table width='100%'><tr><td><script type="text/javascript"><!--
google_ad_client = "pub-4503439170693445";
/* 300x250, created 7/21/10 */
google_ad_slot = "7608120147";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br>When Marshall and Lily fear they will never get pregnant, they see a specialist who can hopefully help move the process along. Meanwhile, Robin starts her new job.<br><br><b>Source: </b>CBS

<br>&nbsp;</td></tr><tr><td><b>There are no foreign summaries for this episode:</b> <a href='/edit/shows/3918/episode_foreign_summary/?eid=1065002553&season=6'>Contribute</a></td></tr><tr><td><b>English Recap Available: </b> <a href='/How_I_Met_Your_Mother/episodes/1065002553?show_recap=1'>View Here</a></td></tr></table></td><td valign='top' width='250'><div align='left'>
<img  alt='How I Met Your Mother season 6 episode 13' src="http://images.tvrage.com/screencaps/20/3918/1065002553.jpg" width="248"  border='0' >
</div><div align='center'><a href='/How_I_Met_Your_Mother/episodes/1065002553?gallery=1'>6 gallery images</a></div></td></tr></table></td></tr><tr>
  <td background='/_layout_v3/buttons/title.jpg' height='39' width='631' align='center'>
<table width='100%' cellpadding='0' cellspacing='0' style='margin: 1px 1px 1px 1px;'>
<tr>
<td align='left'  style='cursor: pointer;' onclick="SwitchHeader('ieconn3','iehide3','26')"  width='90'>&nbsp;<span style='font-size: 15px;   font-weight: bold; color: black; padding-left: 8px;' id='iehide3'><img src='/_layout_v3/misc/minus.gif' width='26'></span></td>
<td align='center'  style='cursor: pointer;' onclick="SwitchHeader('ieconn3','iehide3','26')" ><h5 class='nospace'>Sponsored Links</h5><a name=''></a></td>

<td align='left' width='90' >&nbsp;</td></tr></table></td>
</tr></html>

All I want to get is this text: "When Marshall and Lily fear they will never get pregnant, they see a specialist who can hopefully help move the process along. Meanwhile, Robin starts her new job. "

© Stack Overflow or respective owner

Related posts about php

Related posts about html