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>
Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
chadmanvb

8/22/2022 - Mon
Robberbaron (robr)

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 ?
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
Robberbaron (robr)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
chadmanvb

ASKER
Thanks so much!  you solution worked great.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy