Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing Data

Status
Not open for further replies.

virgo

Programmer
Jun 21, 1999
88
US
I need to be able to select data that occurs between 2 HTML tags. I am using 5. Any suggestions?
 
You could try to use this logic:<br>
Put all the relevant html into a string, use INSTR to find the first tag and the end tag and pick out the data between the two locations.<br>
e.g.<br>
--------------- code -----------------------------------<br>
<br>
dim strHTML as string, strWhatIsWanted as string<br>
dim strStartTag as string, strEndTag as string<br>
dim iStart as integer, iEnd as integer<br>
<br>
strStartTag = &quot;&lt;starttag&gt;&quot;<br>
strEndTag = &quot;&lt;/starttag&gt;&quot;<br>
<br>
strHTML = (concatenate all the lines of html into one string)<br>
<br>
iStart = instr(strHTML, strStartTag)<br>
iend = instr(strHTML, strEndTag)<br>
<br>
strWhatIsWanted = mid(iStart + len(strStartTag), iEnd -(iStart + len(strStartTag))<br>
<br>
--------------- end code -------------------------------<br>
<br>
NOTE: this is untested code so you may need to adjust the start and end positions for the &quot;mid&quot; function.<br>
<br>
HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top