Link to home
Start Free TrialLog in
Avatar of chadmanvb
chadmanvb

asked on

parse section of html file with visual basic .net

I have a long htm file and I'm trying to get a small section of it.  Below is part of the file.  I want to find and grab "this is what I want to grab, but the data can change".  The text before/after it will.  How can I do that?

<tr><td>&nbsp;</td></tr>
         <tr> <TD align="center" COLSPAN=6 style="background-color:#FFFFFF">
                  <div style="background-color:b9d2ff; font-weight:bolder; color:#980000; font-size: 15px">Additional My IP Information - My IP Location Lookup</div>
                </td>
              </tr>
              <tr><td>
                    <table>
                          <tr><td>&nbsp;</td></tr>
                          <tr>
                                <TD width="100%" align='left' valign='top' class="slova">
                                <!--IP Location Code to trace address begin -->
<b>My IP Country Name</b>:&nbsp;&nbsp;<font color='#980000'> United States</font>&nbsp;&nbsp;<img src='images/cflags/us.png'><br><strong>My IP Country Continent</strong>: <font color='#980000'>North America</font>
 <font color='#980000'>(NA)</font>
<br><strong>My IP Country Latitude</strong>: (38)
<br><strong>My IP Country Longitude</strong>: (-98)
<br><b>My IP Country Code</b>:&nbsp;&nbsp;USA&nbsp;&nbsp;(US)<br><br><strong>My IP Address Region</strong>: <font color='#980000'>IL</font>
<br><b>My IP Address City</b>:&nbsp;&nbsp; <font color='#980000'>Chicago</font><br><b>IP Postal Code (IP Zip Code)</b>:&nbsp;&nbsp; <font color='#980000'>63333</font><br /><b>IP Area Code</b>:&nbsp;&nbsp; <font color='#980000'>999</font><br /><b>My IP Address Latitude</b>: (31.71)<br><b>My IP Address Longtitude</b>: (-93.5016)<br><br><strong>My ISP (Internet Service Provider)</strong>:&nbsp;<font color='#980000'> this is what I want to grab, but the data can change</font><br />
<strong>My IP Address lookup</strong> for <b>166.233.222.3</b> show IP which belongs to:&nbsp;<font color='#980000'>more copmany info</font><br />
<b>My Time zone</b>: America/Chicago<br><b>My Local time</b>:<span id=localTime>America/Chicago</span><br></TD>
</TR>
Avatar of Robberbaron (robr)
Robberbaron (robr)
Flag of Australia image

you will need to have some consistent text,
Do you have control of the source HTML ? if so, I have used html comments as placeholders.

<br><strong>My ISP (Internet Service Provider)</strong>:&nbsp;<font color='#980000'> this is what I want to grab, but the data can change</font><br />
<strong>My IP Address lookup</strong> for <b>166.233.222.3</b> show IP which belongs to:&nbsp;<font

do the parts in bold always exist in the response ?
Avatar of chadmanvb
chadmanvb

ASKER

Sorry, I cant control the source and have to work with what I have.  The bold should be the same every time.
ASKER CERTIFIED SOLUTION
Avatar of Robberbaron (robr)
Robberbaron (robr)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks so much!  you solution worked great.