Link to home
Start Free TrialLog in
Avatar of electricd7
electricd7

asked on

Need to find the value between <tag> </tag> using VBscript

Hello,

I have using msxml to scrape the contents of a webpage into a variable (myvar).  Now I want to use VBscript to store the string between 2 specific tags found in the source.  The tags data I want is held between the following:

<div id="myscore">137475</div>

So I want to search the entire myvar variable and end up with a new variable that only holds the value "137475".  Can somone write a function that does this?  Seems like it would be fairly easy to do using InStr, but my brain is asleep this morning!

ED7
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of electricd7
electricd7

ASKER

I must not have RegExp installed?  I get an error on the line "With RegEx" that says:

Object required: 'RegEx'
Sorry, typo.  Change:

    With RegEx

Open in new window


to:

    With RegX

Open in new window

Perfect, thanks!
electricd7,

Glad to help!  If you have not already done so, I would really appreciate it if you could please return to my article
https://www.experts-exchange.com/Programming/Languages/Visual_Basic/A_1336-Using-Regular-Expressions-in-Visual-Basic-for-Applications-and-Visual-Basic-6.html
and click 'Yes' for the 'Was this helpful?' voting.

Patrick