I am pretty new to the HTML Agility Pack so I need some help with where to go next. I can do some simple things like pull a value from an href (knowing the url string I was looking for) and I can pull like the value in a span based on a specific class that was being used. But I do not understand how to use the HTML Agility Pack in a situation where there are a ton of or tags an thre is not one real solid anchor to tie to?
Here is an actual chunk of code I am scraping through. I placed dummy data in the cells to demonstrate what I am looking for.
What is the best way to extract the following:
1.) Company Name?
2.) Phone Number?
3.) Email Address?
HTML....
<td>
<!-- Company Info -->
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="black">
<table cellspacing="1" cellpadding="0" border="0" width="370">
<tr>
<th>COMPANY NAME</th>
</tr>
<tr>
<td class="search">
<table cellpadding="5" cellspacing="0" border="0" width="100%">
<tr>
<td>
<table cellpadding="1" cellspacing="0" border="0" width="100%">
<tr>
<td colspan="2" align="center">Un-needed Links...</td>
</tr>
<tr>
<td align="center" colspan="2"><hr></td>
</tr>
<tr>
<td align="right" nowrap>
<b>
<font color="FF0000">
Contact Person
<img src="/images/icon_contact.gif" align="absmiddle"> :
</font>
</b>
</td>
<td align="left" width="100%"> Judy Smith</td>
</tr>
<tr>
<td align="right" nowrap>
<b><font color="FF0000">Phone Number <img src="/images/icon_phone.gif" align="absmiddle"> :</font></b></td>
<td align="left" width="100%"> 555-555-5555</td>
</tr>
<tr>
<td align="right" nowrap><b><font color="FF0000">E-mail Address <img src="/images/icon_email.gif" align="absmiddle"> :</font></b></td>
<td align="left" width="100%"> <a HREF="mailto:[email protected]">[email protected]</a></td>
</tr>
<tr>
<td align="center" colspan="2"><hr></td>
</tr>
<tr>
<td align="right" nowrap><b><font color="FF0000">Home Office Location <img src="/images/icon_home.gif" align="absmiddle"> :</font></b></td>
<td align="left" width="100%"> ATLANTA, GA</td>
</tr>
<tr>
<td align="right" nowrap><b><font color="FF0000">Home Office Phone <img src="/images/icon_home.gif" align="absmiddle"> :</font></b></td>
<td align="left" width="100%"> 555-555-5555</td>
</tr>
<tr>
<td align="right" nowrap><b><font color="FF0000">Home Office Fax <img src="/images/icon_home.gif" align="absmiddle"> :</font></b></td>
<td align="left" width="100%"> 666-666-6666</td>
</tr>
<tr>
<td align="center" colspan="2"><hr></td>
</tr>
<tr>
<td align="right" nowrap><b><font color="FF0000">Broker MC Number <img src="/images/icon_number.gif" align="absmiddle"> :</font></b></td>
<td align="left" width="100%"> 123456</td>
</tr>
<tr>
<td align="right" nowrap><b><font color="FF0000">Carrier MC Number <img src="/images/icon_number.gif" align="absmiddle"> :</font></b></td>
<td align="left" width="100%"> 654321</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<!-- Starting Point -->
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="black">
<table cellspacing="1" cellpadding="0" border="0" width="370">
<tr>
<th>Starting Point</th>
<th>Available</th>
</tr>
<tr>
<td class="search" width="270"> <b>ABBEVILLE, GA </b></td>
<td class="search" align="center" width="100"><span style="color: forestgreen"> 1/5/11 </span></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<!-- Destination Point -->
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="black">
<table cellspacing="1" cellpadding="0" border="0" width="370">
<tr>
<th>Destination Point</th>
<th>Direction</th>
</tr>
<tr>
<td class="search" width="270"> <b>ATLANTA, GA </b></td>
<td class="search" align="center" width="100"><span style="color: FF0000"> </span></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<!-- Truck Details -->
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="black">
<table cellspacing="1" cellpadding="0" border="0" width="370">
<tr>
<th>Truck Details</th>
</tr>
<tr>
<td class="search">
<table cellpadding="5" cellspacing="0" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="right"><b>Date Posted :</b></td>
<td align="left"> 1/5/2011 10:34:48 AM</td>
</tr>
<tr>
<td align="right"><b>Quantity :</b></td>
<td align="left"> 1</td>
</tr>
<tr>
<td align="right"><b>Equipment Type :</b></td>
<td align="left"> FT</td>
</tr>
<tr>
<td align="right"><b>Load Size :</b></td>
<td align="left"> Full</td>
</tr>
<tr>
<td align="right" valign="top"><b>Special Information :</b></td>
<td align="left"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
</td>
....More HTML