I have a small snippet that captures the html of an external url, and stores it in "xmlhttp.responseText" I want to be able to pick out a section based on one other variable, "isknown", which is a url that would be in an href="" attribute of the <A> tag. Basically, I want to say: if the url "known" exists in the html anywhere then move forward in the code until the unknown anchor text is found, and capture that, and store as a variable. else send error end if I think I can use inStr() to find if the url exists,but not sure wehre i can go from there.
I suppose you are writing a crawler sort of thing. Your best bet is to use regular expressions and iterate until you have no more matches. dim HtmlLinks as String = @"<a[^>]*?href\s*=\s*[""']?"; ' modify this regular expression to suit your needs C# MatchCollection mc = Regex.Matches(xmlhttp.responseText.ToString(), HtmlLinks); foreach (Match mm in mc) { // what you want to do here } Although i've written it in C#, you should be able to easily convert in to VBScript after you've read about Regular Expressions.
okay so ive got the regexp down now, but having trouble implemnting...see thread: http://forums.digitalpoint.com/showthread.php?t=123874