Jump to content
xisto Community
Sign in to follow this  
NotoriousZach

Parsing A List In A Webpage Help Need Webpage Parsing Help

Recommended Posts

Hey I want to parse a list in a webpage.......Im not too hot with parsing overall but I figured this would be the best place to ask for help.....

For example

if the HTML was

<tr><td>1</td><td><A target="_self" href=#><font color=#ff0000>Number1</font></a><td><font face=verdana size=2>IDNUMBER1</td><td><A target="_self" href=#><font color=#ff0000>Number2</font></a><td><font face=verdana size=2>61506</td><td><font face=verdana size=2>ID NUMER2</td>

If i wanted to parse that into a list box where it showed
Number ID
---------------
Number1 IDNUMBER1
Number2 IDNUMBER2


Hopefully you guys can make some sense of that....

note by serverph to NotoriousZach: code-tagged as needed. pls comply next time. :)

Edited by serverph (see edit history)

Share this post


Link to post
Share on other sites

Ok, from what I see without testing the code, I see you have 6 cells, in one row (I assume you accidentaly ommited </td> closing tags)... Now, since the columns you want, are defined in a same way, here is a sample code, that should work (I'll test it, and post back a VB code, if you want)

Index = 0Position = InStr(0,"<td><font face=verdana size=2>")While Position > 0  Position = Position + Len("<td><font face=verdana size=2>")  ClosingTag = InStr(Position,"</td>")  Columns(Index) = Mid(HTML, Position, ClosingTag - Position)  Index = Index + 1  Position = InStr(Position,"<td><font face=verdana size=2>")Wend

You then just need to go through the Columns array, and get the items you need, using some filter...

NOTE: I did not test this code, I wrote it straight from the head, but it should give you some idea what to do. Send me an email if you need further help

Hope this helped some :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.