HTML Scrape

M

mike

I use the following function to glean information from web pages, it was working great until the need developed to pull information from a table. The question is how to pull the information from the tabel into an Excel worksheet

***********************************************************************

Private Function GetRank(strPage, strPrePat, strPostPat As String) As Strin
Dim iStart, iEnd As Intege
Dim strIn, strOut As Strin

GetRank = "
iStart = InStr(1, strPage, strPrePat) ' find first patter
If iStart <> 0 The
iStart = iStart + Len(strPrePat
iEnd = InStr(iStart, strPage, strPostPat) ' secon
If iEnd <> 0 The
strIn = Mid(strPage, iStart, iEnd - iStart
strOut = "
For iStart = 1 To Len(strIn) ' strip out control char
If Mid(strIn, iStart, 1) < " " The
strOut = strOut & " " ' add a blank instea
Els
strOut = strOut & Mid(strIn, iStart, 1
strOut = StrConv(strOut, vbProperCase
End I
Next iStar
GetRank = Trim(strOut) ' return extracted valu
End I
End I
End Functio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top