Solved

Internet Control: search HTML of displayed page

Posted on 2004-03-29
1
132 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

726 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