Solved

Internet Control: search HTML of displayed page

Posted on 2004-03-29
1
130 Views
Last Modified: 2010-05-02
How do I search the HTML of a loaded page for a certain string?

I'm trying to find "of about xxx" where XXX is some number.  I'd like that number.  Regex maybe?

Thanks,
-sam
0
Comment
Question by:samsonite1023
1 Comment
 
LVL 39

Accepted Solution

by:
appari earned 50 total points
ID: 10711597
you can try something like this, get the html of the page displayed in to a string and search for the position of the string "of about" starting from that position + 9, search for a space and extract the string in between the two positions.

eample

dim strBody as string
dim strNum as string
dim intStart as integer, intEnd as integer

strBody = webbrowser1.document.body.innerHTML
intStart = instr(strBody,"of about")
if intStart <>0 then
      intEnd= instr(intStart +9, strbody, " ")
      strNum = mid(strBody,intStart+9,intEnd)
       msgbox strNum
else
      msgbox "String not found"
endif
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSRS expression Issue finding a string 10 79
Validating VB6 Function 19 59
Visual Basic Excel Formatting error 4 105
Error when passing an argument to a vb6 that contains  '/' 7 37
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question