InStr and HTML Screen Scraping problem
From: Phil396 (anonymous_at_discussions.microsoft.com)
Date: 03/10/04
- Next message: Don_at_home.com: "Re: IIf function"
- Previous message: Bob O`Bob: "Re: vailiating SMTP address with Exchange Server"
- Next in thread: ted: "RE: InStr and HTML Screen Scraping problem"
- Reply: ted: "RE: InStr and HTML Screen Scraping problem"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Mar 2004 09:00:48 -0800
I am trying to fix an application that was working
before but now it is not. The VB program will take
an html file, parse out the data to fill with
variables. Here is the problem the Html file
is malformed which will cause the vb program
to scrape the wrong varaibles. Here is the HTML
<TD width="3%">rk </TD>
<TD width="3%">9
<TD width="29%">Jim Ray </TD>
Here is the code that scrapes the HTML file
nStartSpot = InStr(nEndSpot + 1, LCase
(m_DataString), "<td")
nEndSpot = InStr(nStartSpot + 1, LCase
(m_DataString), "</td>")
which will work for other vb variables.
The code wants a </td> for each value in
the HTML table, but as you can see there
is not any </td> at the end of <TD width="3%">9
I tried this
nStartSpot = InStr(nEndSpot + 1, LCase
(m_DataString), "<td")
nEndSpot = InStr(nStartSpot + 1, LCase
(m_DataString), " ")
but with no success. I could potentially crash the
system so I do not want to debug. I also know
  will be converted to an empty string when
the program removes html tags. Any help why my solution
did not fix the problem would be helpful.
- Next message: Don_at_home.com: "Re: IIf function"
- Previous message: Bob O`Bob: "Re: vailiating SMTP address with Exchange Server"
- Next in thread: ted: "RE: InStr and HTML Screen Scraping problem"
- Reply: ted: "RE: InStr and HTML Screen Scraping problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|