|
|
|
|
![]() ![]() |
Mar 20 2005, 11:52 PM
Post
#1
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 55 Joined: 26-February 05 Member No.: 3,996 |
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 CODE <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.... CODE note by serverph to NotoriousZach: code-tagged as needed. pls comply next time. :)
This post has been edited by serverph: Mar 24 2005, 10:17 PM |
|
|
|
Mar 21 2005, 10:06 PM
Post
#2
|
|
|
Neurotical Squirrel ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 590 Joined: 4-November 04 From: Novi Sad, Vojvodina Member No.: 2,127 |
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)
CODE Index = 0 Position = 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 |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 11th October 2008 - 09:14 PM |