Solved

Internet Control: search HTML of displayed page

Posted on 2004-03-29
1
128 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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now